From: Sartak Date: Tue, 16 Dec 2008 22:10:37 +0000 (+0000) Subject: r77573@onn: sartak | 2008-12-16 17:10:11 -0500 X-Git-Tag: v1.003015~78 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cdbe3d31a1e423e5c8f9212fbac037f670bf4af7;p=p5sagit%2FDevel-REPL.git r77573@onn: sartak | 2008-12-16 17:10:11 -0500 Respect env var DEVEL_REPL_PROFILE git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@5242 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/lib/Devel/REPL/Profile.pm b/lib/Devel/REPL/Profile.pm index b449c54..5085298 100644 --- a/lib/Devel/REPL/Profile.pm +++ b/lib/Devel/REPL/Profile.pm @@ -68,6 +68,9 @@ To run the shell with a particular profile, use the following command: system$ re.pl --profile MyProject +Alternatively, you can set the environment variable C to +MyProject. + When the profile name is unqualified, as in the above example, the profile is assumed to be in the C namespace. Otherwise if you pass something which contains the C<::> character sequence, it will be loaded diff --git a/lib/Devel/REPL/Script.pm b/lib/Devel/REPL/Script.pm index aab0cc2..2265638 100644 --- a/lib/Devel/REPL/Script.pm +++ b/lib/Devel/REPL/Script.pm @@ -14,7 +14,10 @@ has 'rcfile' => ( ); has 'profile' => ( - is => 'ro', isa => 'Str', required => 1, default => sub { 'Default' }, + is => 'ro', + isa => 'Str', + required => 1, + default => sub { $ENV{DEVEL_REPL_PROFILE} || 'Default' }, ); has '_repl' => (