Permalink
Browse files

Explicitly require minimum module versions

  • Loading branch information...
1 parent 1bd7284 commit f61d1b3fd7b6b3631cc2008077299652d7369a81 @hoelzro hoelzro committed Dec 4, 2012
Showing with 34 additions and 17 deletions.
  1. +10 −7 Ack.pm
  2. +2 −2 ConfigFinder.pm
  3. +7 −3 ConfigLoader.pm
  4. +1 −1 Filter.pm
  5. +1 −1 Is.pm
  6. +1 −1 Match.pm
  7. +1 −1 Resources.pm
  8. +11 −1 ack
View
17 Ack.pm
@@ -5,8 +5,12 @@ use strict;
use App::Ack::ConfigDefault;
use App::Ack::ConfigFinder;
-use Getopt::Long;
-use File::Next 1.08;
+use Getopt::Long ();
+BEGIN {
+ # see ack for explanation
+ UNIVERSAL::VERSION('Getopt::Long', '2.36');
+}
+use File::Next 1.10;
=head1 NAME
@@ -44,9 +48,8 @@ our $dir_sep_chars;
our $is_cygwin;
our $is_windows;
-use File::Spec ();
-use File::Glob ':glob';
-use Getopt::Long ();
+use File::Spec 1.00015 ();
+use File::Glob 1.00015 ':glob';
BEGIN {
# These have to be checked before any filehandle diddling.
@@ -82,7 +85,7 @@ sub retrieve_arg_sources {
Getopt::Long::Configure('pass_through');
Getopt::Long::Configure('no_auto_abbrev');
- GetOptions(
+ Getopt::Long::GetOptions(
'noenv' => \$noenv,
'ackrc=s' => \$ackrc,
);
@@ -620,7 +623,7 @@ Set default colors, load Term::ANSIColor
=cut
sub load_colors {
- eval 'use Term::ANSIColor ()';
+ eval 'use Term::ANSIColor 3.01 ()';
$ENV{ACK_COLOR_MATCH} ||= 'black on_yellow';
$ENV{ACK_COLOR_FILENAME} ||= 'bold green';
View
@@ -37,8 +37,8 @@ use strict;
use warnings;
use App::Ack ();
-use Cwd ();
-use File::Spec;
+use Cwd 3.00 ();
+use File::Spec 3.00;
BEGIN {
if($App::Ack::is_windows) {
View
@@ -6,9 +6,13 @@ use warnings;
use App::Ack ();
use App::Ack::Filter;
use App::Ack::Filter::Default;
-use Carp ();
-use Getopt::Long; # Must be 2.36, but we can't check for that in the use.
-use Text::ParseWords ();
+use Carp 1.22 ();
+use Getopt::Long ();
+BEGIN {
+ # see ack for explanation
+ UNIVERSAL::VERSION('Getopt::Long', '2.36');
+}
+use Text::ParseWords 3.1 ();
=head1 App::Ack::ConfigLoader
View
@@ -6,7 +6,7 @@ use overload
'""' => 'to_string';
use App::Ack::Filter::Inverse ();
-use Carp ();
+use Carp 1.22 ();
my %filter_types;
View
2 Is.pm
@@ -4,7 +4,7 @@ use strict;
use warnings;
use base 'App::Ack::Filter';
-use File::Spec ();
+use File::Spec 3.00 ();
sub new {
my ( $class, $filename ) = @_;
View
@@ -4,7 +4,7 @@ use strict;
use warnings;
use base 'App::Ack::Filter';
-use File::Spec;
+use File::Spec 3.00;
sub new {
my ( $class, $re ) = @_;
View
@@ -2,7 +2,7 @@ package App::Ack::Resources;
use App::Ack;
-use File::Next;
+use File::Next 1.10;
use warnings;
use strict;
View
12 ack
@@ -20,8 +20,18 @@ use App::Ack::Filter::Is;
use App::Ack::Filter::Match;
use Getopt::Long ();
+=for Explanation
+ Getopt::Long stores the requested version and uses it to
+ generate --help and --version handlers if requested. Interestingly
+ enough, we don't request them, but we get a fun error message from
+ Getopt::Long anyway. This BEGIN block (and others like it) gets
+ around the issue, but we should probably fix it for real some day.
+=cut
+BEGIN {
+ UNIVERSAL::VERSION('Getopt::Long', '2.36');
+}
-use Carp ();
+use Carp 1.22 ();
our $VERSION = '2.00a01';
# Check http://betterthangrep.com/ for updates

0 comments on commit f61d1b3

Please sign in to comment.