Skip to content

Commit

Permalink
made source directory detection slightly more efficient
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 18, 2012
1 parent 7d45d6a commit 91115f1
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,6 +1,6 @@
This file documents the revision history for Perl extension Mojolicious.

2.51 2012-02-18 00:00:00
2.51 2012-02-19 00:00:00
- Removed experimental status from around_dispatch hook.
- Removed experimental status from emit_chain method in
Mojolicious::Plugins.
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojolicious/Command/generate/app.pm
Expand Up @@ -58,9 +58,8 @@ use File::Spec::Functions qw/catdir splitdir/;
# Source directory has precedence
my @base = (splitdir(dirname(__FILE__)), '..');
-e catdir(@base, 't')
? unshift(@INC, join('/', @base, 'lib'))
: push(@INC, join('/', @base, 'lib'));
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);
# Check if Mojolicious is installed;
die <<EOF unless eval 'use Mojolicious::Commands; 1';
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojolicious/Guides/Growing.pod
Expand Up @@ -659,9 +659,8 @@ environments.

# Source directory has precedence
my @base = (splitdir(dirname(__FILE__)), '..');
-e catdir(@base, 't')
? unshift(@INC, join('/', @base, 'lib'))
: push(@INC, join('/', @base, 'lib'));
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojolicious::Commands; 1';
Expand Down
5 changes: 2 additions & 3 deletions script/hypnotoad
Expand Up @@ -9,9 +9,8 @@ use Getopt::Long qw/GetOptions :config no_auto_abbrev no_ignore_case/;

# Source directory has precedence
my @base = (splitdir(dirname(__FILE__)), '..');
-e catdir(@base, 't')
? unshift(@INC, join('/', @base, 'lib'))
: push(@INC, join('/', @base, 'lib'));
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojo::Server::Hypnotoad; 1';
Expand Down
5 changes: 2 additions & 3 deletions script/mojo
Expand Up @@ -8,9 +8,8 @@ use File::Spec::Functions qw/catdir splitdir/;

# Source directory has precedence
my @base = (splitdir(dirname(__FILE__)), '..');
-e catdir(@base, 't')
? unshift(@INC, join('/', @base, 'lib'))
: push(@INC, join('/', @base, 'lib'));
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojolicious::Commands; 1';
Expand Down
5 changes: 2 additions & 3 deletions script/morbo
Expand Up @@ -9,9 +9,8 @@ use Getopt::Long qw/GetOptions :config no_auto_abbrev no_ignore_case/;

# Source directory has precedence
my @base = (splitdir(dirname(__FILE__)), '..');
-e catdir(@base, 't')
? unshift(@INC, join('/', @base, 'lib'))
: push(@INC, join('/', @base, 'lib'));
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojo::Server::Morbo; 1';
Expand Down
5 changes: 2 additions & 3 deletions t/mojolicious/external/script/my_app
Expand Up @@ -14,9 +14,8 @@ use File::Spec::Functions qw/catdir splitdir/;

# Source directory has precedence
my @base = (splitdir(dirname(__FILE__)), '..');
-e catdir(@base, 't')
? unshift(@INC, join('/', @base, 'lib'))
: push(@INC, join('/', @base, 'lib'));
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojolicious::Commands; 1';
Expand Down

0 comments on commit 91115f1

Please sign in to comment.