use strict; use warnings; use inc::Module::Install; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'WWW::Selenium::Utils', VERSION_FROM => 'lib/WWW/Selenium/Utils.pm', # finds $VERSION PREREQ_PM => { 'Test::Exception' => 0, }, ABSTRACT => 'Handy utilities for working with Selenium', AUTHOR => 'Luke Closs ', EXE_FILES => [ qw(bin/selenium-regen) ], clean => { FILES => 't/foo.conf t/tests t/index.html t/etc ' . 'lib/WWW/Selenium/Utils/Actions.pm' }, ); # Module::Install Stuff { license ('perl'); # Needed to activate PAR functionality. par_base('LUKEC'); } # auto-generate WWW::Selenium::Utils::Actions my $actfile = "lib/WWW/Selenium/Utils/Actions.pm"; unlink $actfile if -e $actfile; open(my $ofh, ">$actfile") or die "Can't open $actfile: $!"; print $ofh <) { next unless /^Selenium\.prototype\.do(\w+)\s*=\s*function\(([^\)]*)\)/; my ($basefunc, $args) = (lc($1), $2); my @args = split /,\s*/, $args; my $numargs = @args; print $ofh " $basefunc => $numargs,\n"; } close $ifh or die "Can't close $: $!"; print $ofh ");\n1;\n"; close $ofh or die "Can't write $selapi: $!";