From 2a6d70163d5db534768c79cf48afc8f3c3c61485 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 08:24:24 +0300 Subject: [PATCH 01/12] _list func --- lib/App/virtualenv.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/App/virtualenv.pm b/lib/App/virtualenv.pm index 4967e37..5296ba3 100644 --- a/lib/App/virtualenv.pm +++ b/lib/App/virtualenv.pm @@ -11,13 +11,14 @@ use Perl::Shell; use Term::ReadLine; use Config; use Lexical::Persistence; +use ExtUtils::Installed; BEGIN { require Exporter; # set the version for version checking - our $VERSION = '1.02'; + our $VERSION = '1.03'; # Inherit from Exporter to export functions and variables our @ISA = qw(Exporter); # Functions and variables which are exported by default @@ -225,5 +226,21 @@ sub shell return perl($virtualEnvPath, "-MApp::virtualenv", "-eApp::virtualenv::_shell();"); } +sub _list +{ + my $inst = ExtUtils::Installed->new(); + my @perl5lib = split(":", $ENV{PERL5LIB}); + my $perl5lib = $perl5lib[0] if defined $perl5lib[0]; + my @modules = $inst->modules(); + for my $module (sort {lc($a) cmp lc($b)} @modules) + { + my @files = $inst->files($module, "all", $perl5lib); + my $version = $inst->version($module); + my $space = " "; + my $spaces = substr($space, -length($space)+length($module)); + say "$module $spaces $version" if @files; + } +} + 1; From 28d73d351a02835a60a3531545ca05a2a5cb6f18 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 08:26:47 +0300 Subject: [PATCH 02/12] renaming App::virtualenv -> App::Virtualenv --- lib/App/{virtualenv.pm => Virtualenv.pm} | 0 lib/App/{virtualenv => Virtualenv}/activate | 0 lib/App/{virtualenv => Virtualenv}/perl.pl | 0 lib/App/{virtualenv => Virtualenv}/sh.pl | 0 lib/App/{virtualenv => Virtualenv}/shell.pl | 0 lib/App/{virtualenv => Virtualenv}/virtualenv.pl | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename lib/App/{virtualenv.pm => Virtualenv.pm} (100%) rename lib/App/{virtualenv => Virtualenv}/activate (100%) rename lib/App/{virtualenv => Virtualenv}/perl.pl (100%) rename lib/App/{virtualenv => Virtualenv}/sh.pl (100%) rename lib/App/{virtualenv => Virtualenv}/shell.pl (100%) rename lib/App/{virtualenv => Virtualenv}/virtualenv.pl (100%) diff --git a/lib/App/virtualenv.pm b/lib/App/Virtualenv.pm similarity index 100% rename from lib/App/virtualenv.pm rename to lib/App/Virtualenv.pm diff --git a/lib/App/virtualenv/activate b/lib/App/Virtualenv/activate similarity index 100% rename from lib/App/virtualenv/activate rename to lib/App/Virtualenv/activate diff --git a/lib/App/virtualenv/perl.pl b/lib/App/Virtualenv/perl.pl similarity index 100% rename from lib/App/virtualenv/perl.pl rename to lib/App/Virtualenv/perl.pl diff --git a/lib/App/virtualenv/sh.pl b/lib/App/Virtualenv/sh.pl similarity index 100% rename from lib/App/virtualenv/sh.pl rename to lib/App/Virtualenv/sh.pl diff --git a/lib/App/virtualenv/shell.pl b/lib/App/Virtualenv/shell.pl similarity index 100% rename from lib/App/virtualenv/shell.pl rename to lib/App/Virtualenv/shell.pl diff --git a/lib/App/virtualenv/virtualenv.pl b/lib/App/Virtualenv/virtualenv.pl similarity index 100% rename from lib/App/virtualenv/virtualenv.pl rename to lib/App/Virtualenv/virtualenv.pl From e5613a122d11edd6b336bb91b0eb8cd4441d7d93 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 09:44:42 +0300 Subject: [PATCH 03/12] replacing App::virtualenv -> App::Virtualenv --- .gitignore | 23 +++++-- MANIFEST | 14 ++--- Makefile.PL | 6 +- README.md | 2 +- lib/App/Virtualenv.pm | 70 +++++++++++----------- lib/App/Virtualenv/perl.pl | 4 +- lib/App/Virtualenv/sh.pl | 4 +- lib/App/Virtualenv/shell.pl | 4 +- lib/App/Virtualenv/virtualenv.pl | 6 +- t/{perl5-virtualenv.t => App-Virtualenv.t} | 2 +- tests.pl | 6 +- 11 files changed, 79 insertions(+), 62 deletions(-) rename t/{perl5-virtualenv.t => App-Virtualenv.t} (60%) diff --git a/.gitignore b/.gitignore index 9de7bca..c13c696 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,22 @@ -.project -.includepath -.settings/** +*.project +*.includepath +*.settings -.DS_Store +*.DS_Store *.sublime-project *.sublime-workspace + +*.bak +*.old +*.tar +*.tar.* +*~ + +/MYMETA.json +/MYMETA.yml +/Makefile +/_build +/blib +/pm_to_blib + +/App-Virtualenv-* diff --git a/MANIFEST b/MANIFEST index 05407d4..898d3d5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3,11 +3,11 @@ LICENSE MANIFEST Makefile.PL README.md -lib/App/virtualenv.pm -lib/App/virtualenv/activate -lib/App/virtualenv/perl.pl -lib/App/virtualenv/sh.pl -lib/App/virtualenv/shell.pl -lib/App/virtualenv/virtualenv.pl -t/perl5-virtualenv.t +lib/App/Virtualenv.pm +lib/App/Virtualenv/activate +lib/App/Virtualenv/perl.pl +lib/App/Virtualenv/sh.pl +lib/App/Virtualenv/shell.pl +lib/App/Virtualenv/virtualenv.pl +t/App-Virtualenv.t tests.pl diff --git a/Makefile.PL b/Makefile.PL index eb81e59..ade71db 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -23,11 +23,11 @@ use ExtUtils::MakeMaker; WriteMakefile( - NAME => 'App::virtualenv', - VERSION_FROM => 'lib/App/virtualenv.pm', + NAME => 'App::Virtualenv', + VERSION_FROM => 'lib/App/Virtualenv.pm', MIN_PERL_VERSION => 'v5.10', PREREQ_PM => { 'local::lib' => 0, 'Switch' => 0, 'FindBin' => 0, 'Cwd' => 0, 'File::Basename' => 0, 'Perl::Shell' => 0 }, - EXE_FILES => [ qw(lib/App/virtualenv/virtualenv.pl lib/App/virtualenv/sh.pl lib/App/virtualenv/perl.pl lib/App/virtualenv/shell.pl) ], + EXE_FILES => [ qw(lib/App/Virtualenv/virtualenv.pl lib/App/Virtualenv/sh.pl lib/App/Virtualenv/perl.pl lib/App/Virtualenv/shell.pl) ], AUTHOR => 'Orkun Karaduman ', ABSTRACT => 'Virtual environment for Perl 5', LICENSE => 'gpl_3', diff --git a/README.md b/README.md index f647b32..4abaf15 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ To install this module type the following: or -> cpanm https://github.com/orkunkaraduman/perl5-virtualenv/archive/v1.02.tar.gz +> cpanm https://github.com/orkunkaraduman/perl5-virtualenv/archive/v1.03.tar.gz ## DEPENDENCIES diff --git a/lib/App/Virtualenv.pm b/lib/App/Virtualenv.pm index 5296ba3..a72eb97 100644 --- a/lib/App/Virtualenv.pm +++ b/lib/App/Virtualenv.pm @@ -1,4 +1,4 @@ -package App::virtualenv; +package App::Virtualenv; use strict; use warnings; no warnings qw(qw utf8 redefine); @@ -33,36 +33,36 @@ BEGIN sub activate { - my ($virtualEnvPath) = @_; - $virtualEnvPath = getVirtualEnv() if not defined $virtualEnvPath; - $virtualEnvPath = binVirtualEnv() if not defined $virtualEnvPath; - $virtualEnvPath = Cwd::realpath($virtualEnvPath); - warn "Virtual environment is not valid" if not validVirtualEnv($virtualEnvPath); + my ($virtualenvPath) = @_; + $virtualenvPath = getVirtualenvPath() if not defined $virtualenvPath; + $virtualenvPath = binVirtualenvPath() if not defined $virtualenvPath; + $virtualenvPath = Cwd::realpath($virtualenvPath); + warn "Virtual environment is not valid" if not validVirtualenvPath($virtualenvPath); deactivate(1); $ENV{_OLD_PERL_VIRTUAL_ENV} = $ENV{PERL_VIRTUAL_ENV}; - $ENV{PERL_VIRTUAL_ENV} = $virtualEnvPath; + $ENV{PERL_VIRTUAL_ENV} = $virtualenvPath; $ENV{_OLD_PERL_VIRTUAL_PATH} = $ENV{PATH}; - $ENV{PATH} = "$virtualEnvPath/bin".((defined $ENV{PATH})? ":${ENV{PATH}}": ""); + $ENV{PATH} = "$virtualenvPath/bin".((defined $ENV{PATH})? ":${ENV{PATH}}": ""); $ENV{_OLD_PERL_VIRTUAL_PERL5LIB} = $ENV{PERL5LIB}; - $ENV{PERL5LIB} = "$virtualEnvPath/lib/perl5".((defined $ENV{PERL5LIB})? ":${ENV{PERL5LIB}}": ""); + $ENV{PERL5LIB} = "$virtualenvPath/lib/perl5".((defined $ENV{PERL5LIB})? ":${ENV{PERL5LIB}}": ""); $ENV{_OLD_PERL_VIRTUAL_PERL_LOCAL_LIB_ROOT} = $ENV{PERL_LOCAL_LIB_ROOT}; - $ENV{PERL_LOCAL_LIB_ROOT} = "$virtualEnvPath"; + $ENV{PERL_LOCAL_LIB_ROOT} = "$virtualenvPath"; $ENV{_OLD_PERL_VIRTUAL_PERL_MB_OPT} = $ENV{PERL_MB_OPT}; - $ENV{PERL_MB_OPT} = "--install_base \"$virtualEnvPath\""; + $ENV{PERL_MB_OPT} = "--install_base \"$virtualenvPath\""; $ENV{_OLD_PERL_VIRTUAL_PERL_MM_OPT} = $ENV{PERL_MM_OPT}; - $ENV{PERL_MM_OPT} = "INSTALL_BASE=$virtualEnvPath"; + $ENV{PERL_MM_OPT} = "INSTALL_BASE=$virtualenvPath"; $ENV{_OLD_PERL_VIRTUAL_PS1} = $ENV{PS1}; - $ENV{PS1} = "(" . basename($virtualEnvPath) . ") ".((defined $ENV{PS1})? $ENV{PS1}: ""); + $ENV{PS1} = "(" . basename($virtualenvPath) . ") ".((defined $ENV{PS1})? $ENV{PS1}: ""); - return $virtualEnvPath; + return $virtualenvPath; } sub deactivate @@ -95,43 +95,43 @@ sub deactivate return; } -sub getVirtualEnv +sub getVirtualenvPath { return (defined $ENV{PERL_VIRTUAL_ENV})? Cwd::realpath($ENV{PERL_VIRTUAL_ENV}): undef; } -sub binVirtualEnv +sub binVirtualenvPath { return Cwd::realpath("${FindBin::Bin}/.."); } -sub validVirtualEnv +sub validVirtualenvPath { - my ($virtualEnvPath) = @_; - return 0 if not defined $virtualEnvPath; - $virtualEnvPath = Cwd::realpath($virtualEnvPath); - return -d "$virtualEnvPath/lib/perl5"; + my ($virtualenvPath) = @_; + return 0 if not defined $virtualenvPath; + $virtualenvPath = Cwd::realpath($virtualenvPath); + return -d "$virtualenvPath/lib/perl5"; } sub create { - my ($virtualEnvPath) = @_; - $virtualEnvPath = Cwd::realpath((defined $virtualEnvPath)? $virtualEnvPath: "."); + my ($virtualenvPath) = @_; + $virtualenvPath = Cwd::realpath((defined $virtualenvPath)? $virtualenvPath: "."); deactivate(); require local::lib; - local::lib->import($virtualEnvPath); + local::lib->import($virtualenvPath); - activate($virtualEnvPath); + activate($virtualenvPath); system("/usr/bin/perl -MCPAN -e \"CPAN::install('LWP', 'CPAN', 'App::cpanminus', 'App::cpanoutdated')\""); my $pkgPath = dirname(__FILE__); - system("cp -v $pkgPath/virtualenv/activate $virtualEnvPath/bin/activate && chmod 644 $virtualEnvPath/bin/activate"); - system("cp -v $pkgPath/virtualenv/sh.pl $virtualEnvPath/bin/sh.pl && chmod 755 $virtualEnvPath/bin/sh.pl"); - system("cp -v $pkgPath/virtualenv/perl.pl $virtualEnvPath/bin/perl.pl && chmod 755 $virtualEnvPath/bin/perl.pl"); - system("cp -v $pkgPath/virtualenv/shell.pl $virtualEnvPath/bin/shell.pl && chmod 755 $virtualEnvPath/bin/shell.pl"); + system("cp -v $pkgPath/Virtualenv/activate $virtualenvPath/bin/activate && chmod 644 $virtualenvPath/bin/activate"); + system("cp -v $pkgPath/Virtualenv/sh.pl $virtualenvPath/bin/sh.pl && chmod 755 $virtualenvPath/bin/sh.pl"); + system("cp -v $pkgPath/Virtualenv/perl.pl $virtualenvPath/bin/perl.pl && chmod 755 $virtualenvPath/bin/perl.pl"); + system("cp -v $pkgPath/Virtualenv/shell.pl $virtualenvPath/bin/shell.pl && chmod 755 $virtualenvPath/bin/shell.pl"); return 1; } @@ -159,8 +159,8 @@ sub _sh sub sh { - my ($virtualEnvPath, @args) = @_; - $virtualEnvPath = activate($virtualEnvPath); + my ($virtualenvPath, @args) = @_; + $virtualenvPath = activate($virtualenvPath); return _sh(@args); } @@ -172,8 +172,8 @@ sub _perl sub perl { - my ($virtualEnvPath, @args) = @_; - $virtualEnvPath = activate($virtualEnvPath); + my ($virtualenvPath, @args) = @_; + $virtualenvPath = activate($virtualenvPath); return _perl(@args); } @@ -222,8 +222,8 @@ sub _shell sub shell { - my ($virtualEnvPath, @args) = @_; - return perl($virtualEnvPath, "-MApp::virtualenv", "-eApp::virtualenv::_shell();"); + my ($virtualenvPath, @args) = @_; + return perl($virtualenvPath, "-MApp::Virtualenv", "-eApp::Virtualenv::_shell();"); } sub _list diff --git a/lib/App/Virtualenv/perl.pl b/lib/App/Virtualenv/perl.pl index 926abb0..b0a0183 100755 --- a/lib/App/Virtualenv/perl.pl +++ b/lib/App/Virtualenv/perl.pl @@ -7,7 +7,7 @@ use open qw(:std :locale); use utf8; -use App::virtualenv; +use App::Virtualenv; -exit App::virtualenv::perl(undef, @ARGV); +exit App::Virtualenv::perl(undef, @ARGV); diff --git a/lib/App/Virtualenv/sh.pl b/lib/App/Virtualenv/sh.pl index 9eb5375..d1edeb6 100755 --- a/lib/App/Virtualenv/sh.pl +++ b/lib/App/Virtualenv/sh.pl @@ -7,7 +7,7 @@ use open qw(:std :locale); use utf8; -use App::virtualenv; +use App::Virtualenv; -exit App::virtualenv::sh(undef, @ARGV); +exit App::Virtualenv::sh(undef, @ARGV); diff --git a/lib/App/Virtualenv/shell.pl b/lib/App/Virtualenv/shell.pl index 6524727..cb908a8 100755 --- a/lib/App/Virtualenv/shell.pl +++ b/lib/App/Virtualenv/shell.pl @@ -7,7 +7,7 @@ use open qw(:std :locale); use utf8; -use App::virtualenv; +use App::Virtualenv; -exit App::virtualenv::shell(undef, @ARGV); +exit App::Virtualenv::shell(undef, @ARGV); diff --git a/lib/App/Virtualenv/virtualenv.pl b/lib/App/Virtualenv/virtualenv.pl index b5aeef2..2bc15ea 100755 --- a/lib/App/Virtualenv/virtualenv.pl +++ b/lib/App/Virtualenv/virtualenv.pl @@ -7,8 +7,8 @@ use open qw(:std :locale); use utf8; -use App::virtualenv; +use App::Virtualenv; -my ($virtualEnv) = @ARGV; -exit not App::virtualenv::create($virtualEnv); +my ($virtualenv) = @ARGV; +exit not App::Virtualenv::create($virtualenv); diff --git a/t/perl5-virtualenv.t b/t/App-Virtualenv.t similarity index 60% rename from t/perl5-virtualenv.t rename to t/App-Virtualenv.t index 06f856d..c4015eb 100644 --- a/t/perl5-virtualenv.t +++ b/t/App-Virtualenv.t @@ -3,4 +3,4 @@ use warnings; use Test::More tests => 1; -BEGIN { use_ok('App::virtualenv') } +BEGIN { use_ok('App::Virtualenv') } diff --git a/tests.pl b/tests.pl index 636bd9d..e42d24f 100755 --- a/tests.pl +++ b/tests.pl @@ -8,7 +8,9 @@ use utf8; use lib './lib/'; -use App::virtualenv; +use App::Virtualenv; -exit App::virtualenv::shell(undef, @ARGV); +App::Virtualenv::_list(); + +exit 0; From 7d897af10ca5126f61b4f9ad644bee82b678aae2 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 10:34:35 +0300 Subject: [PATCH 04/12] Module.pm --- MANIFEST | 1 + lib/App/Virtualenv.pm | 16 ----------- lib/App/Virtualenv/Module.pm | 53 ++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 lib/App/Virtualenv/Module.pm diff --git a/MANIFEST b/MANIFEST index 898d3d5..09fb438 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4,6 +4,7 @@ MANIFEST Makefile.PL README.md lib/App/Virtualenv.pm +lib/App/Virtualenv/Module.pm lib/App/Virtualenv/activate lib/App/Virtualenv/perl.pl lib/App/Virtualenv/sh.pl diff --git a/lib/App/Virtualenv.pm b/lib/App/Virtualenv.pm index a72eb97..22140bb 100644 --- a/lib/App/Virtualenv.pm +++ b/lib/App/Virtualenv.pm @@ -226,21 +226,5 @@ sub shell return perl($virtualenvPath, "-MApp::Virtualenv", "-eApp::Virtualenv::_shell();"); } -sub _list -{ - my $inst = ExtUtils::Installed->new(); - my @perl5lib = split(":", $ENV{PERL5LIB}); - my $perl5lib = $perl5lib[0] if defined $perl5lib[0]; - my @modules = $inst->modules(); - for my $module (sort {lc($a) cmp lc($b)} @modules) - { - my @files = $inst->files($module, "all", $perl5lib); - my $version = $inst->version($module); - my $space = " "; - my $spaces = substr($space, -length($space)+length($module)); - say "$module $spaces $version" if @files; - } -} - 1; diff --git a/lib/App/Virtualenv/Module.pm b/lib/App/Virtualenv/Module.pm new file mode 100644 index 0000000..7b1a00b --- /dev/null +++ b/lib/App/Virtualenv/Module.pm @@ -0,0 +1,53 @@ +package App::Virtualenv::Module; +use strict; +use warnings; +no warnings qw(qw utf8); +use v5.10; +use utf8; +use FindBin; +use Cwd; +use File::Basename; +use Term::ReadLine; +use Config; +use ExtUtils::Installed; + + +BEGIN +{ + require Exporter; + # set the version for version checking + our $VERSION = $App::Virtualenv::VERSION; + # Inherit from Exporter to export functions and variables + our @ISA = qw(Exporter); + # Functions and variables which are exported by default + our @EXPORT = qw(); + # Functions and variables which can be optionally exported + our @EXPORT_OK = qw(); + + $ENV{PERL_RL} = 'gnu o=0'; + require Term::ReadLine; +} + + +sub list +{ + my $inst = ExtUtils::Installed->new(); + my @perl5lib = split(":", $ENV{PERL5LIB}); + my $perl5lib = $perl5lib[0]; + return 0 if not defined $perl5lib; + my @modules = $inst->modules(); + for my $module (sort {lc($a) cmp lc($b)} @modules) + { + my @files = $inst->files($module, "all", $perl5lib); + my $version = $inst->version($module); + my $space = " "; + my $len = length($space)-length($module); + my $spaces = substr($space, -$len); + $spaces = "" if $len <= 0; + say "$module $spaces $version" if @files; + } + return 1; +} + + +1; From 7120ff397df54bbc8d09131313d19b0755256241 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 10:54:30 +0300 Subject: [PATCH 05/12] Module.pm changes --- lib/App/Virtualenv/Module.pm | 7 ++++--- tests.pl | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/App/Virtualenv/Module.pm b/lib/App/Virtualenv/Module.pm index 7b1a00b..5843309 100644 --- a/lib/App/Virtualenv/Module.pm +++ b/lib/App/Virtualenv/Module.pm @@ -39,12 +39,13 @@ sub list for my $module (sort {lc($a) cmp lc($b)} @modules) { my @files = $inst->files($module, "all", $perl5lib); - my $version = $inst->version($module); - my $space = " "; + my $space = " "; my $len = length($space)-length($module); my $spaces = substr($space, -$len); $spaces = "" if $len <= 0; - say "$module $spaces $version" if @files; + my $version = $inst->version($module); + $version = "undef" if not $version; + say "$module$spaces $version" if @files; } return 1; } diff --git a/tests.pl b/tests.pl index e42d24f..eb22a42 100755 --- a/tests.pl +++ b/tests.pl @@ -8,9 +8,9 @@ use utf8; use lib './lib/'; -use App::Virtualenv; +use App::Virtualenv::Module; -App::Virtualenv::_list(); +App::Virtualenv::Module::list(); exit 0; From 958eeaece8226bed4d03c3c7c9d24433530d3802 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 13:12:48 +0300 Subject: [PATCH 06/12] perlpod & README --- Makefile.PL | 18 ---------------- README.md | 34 ++++++++++++++++++------------ lib/App/Virtualenv.pm | 36 +++++++++++++++++++++++++++++++- lib/App/Virtualenv/Module.pm | 35 +++++++++++++++++++++++++++++++ lib/App/Virtualenv/perl.pl | 36 ++++++++++++++++++++++++++++++++ lib/App/Virtualenv/sh.pl | 36 ++++++++++++++++++++++++++++++++ lib/App/Virtualenv/shell.pl | 36 ++++++++++++++++++++++++++++++++ lib/App/Virtualenv/virtualenv.pl | 36 ++++++++++++++++++++++++++++++++ tests.pl | 34 ++++++++++++++++++++++++++++++ 9 files changed, 269 insertions(+), 32 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index ade71db..69ccc5b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,21 +1,3 @@ -=Copyright -Copyright (C) 2016 Orkun Karaduman -=GPLv3 -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -=cut - - use strict; use warnings; use v5.10; diff --git a/README.md b/README.md index 4abaf15..a5e7dae 100644 --- a/README.md +++ b/README.md @@ -5,29 +5,41 @@ perl5-virtualenv is a tool to create isolated Perl 5 virtual environments, like ## USAGE -**virtualenv.pl [*environment_path*]** +### virtualenv.pl creates new Perl virtual environment -**source *environment_path*/bin/activate** - -activates Perl virtual environment +**virtualenv.pl [*environment_path*]** -**deactivate** +### sh.pl -deactivates Perl virtual environment +runs Unix shell under Perl virtual environment **[*environment_path*/bin/]sh.pl** -runs Unix shell under Perl virtual environment +### perl.pl + +runs Perl language interpreter under Perl virtual environment **[*environment_path*/bin/]perl.pl [*argument*]...** -runs Perl language interpreter under Perl virtual environment +### shell.pl + +runs Perl shell interpreter under Perl virtual environment **[*environment_path*/bin/]shell.pl** -runs Perl shell interpreter under Perl virtual environment +### activate + +activates Perl virtual environment + +**source *environment_path*/bin/activate** + +### deactivate + +deactivates Perl virtual environment + +**deactivate** ## INSTALLATION @@ -41,10 +53,6 @@ To install this module type the following: > > make install -or - -> cpanm https://github.com/orkunkaraduman/perl5-virtualenv/archive/v1.03.tar.gz - ## DEPENDENCIES This module requires these other modules and libraries: diff --git a/lib/App/Virtualenv.pm b/lib/App/Virtualenv.pm index 22140bb..b367543 100644 --- a/lib/App/Virtualenv.pm +++ b/lib/App/Virtualenv.pm @@ -1,4 +1,17 @@ package App::Virtualenv; +=head1 NAME + +App::Virtualenv + +=head1 VERSION + +version 1.03 + +=head1 SYNOPSIS + + + +=cut use strict; use warnings; no warnings qw(qw utf8 redefine); @@ -11,7 +24,6 @@ use Perl::Shell; use Term::ReadLine; use Config; use Lexical::Persistence; -use ExtUtils::Installed; BEGIN @@ -228,3 +240,25 @@ sub shell 1; +=head1 AUTHOR + +Orkun Karaduman + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2016 Orkun Karaduman + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +=cut diff --git a/lib/App/Virtualenv/Module.pm b/lib/App/Virtualenv/Module.pm index 5843309..8b36617 100644 --- a/lib/App/Virtualenv/Module.pm +++ b/lib/App/Virtualenv/Module.pm @@ -1,4 +1,17 @@ package App::Virtualenv::Module; +=head1 NAME + +App::Virtualenv::Module + +=head1 VERSION + +same with App::Virtualenv + +=head1 SYNOPSIS + +This module is not completely implemented yet. + +=cut use strict; use warnings; no warnings qw(qw utf8); @@ -52,3 +65,25 @@ sub list 1; +=head1 AUTHOR + +Orkun Karaduman + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2016 Orkun Karaduman + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +=cut diff --git a/lib/App/Virtualenv/perl.pl b/lib/App/Virtualenv/perl.pl index b0a0183..2d21a61 100755 --- a/lib/App/Virtualenv/perl.pl +++ b/lib/App/Virtualenv/perl.pl @@ -1,5 +1,19 @@ #! /usr/bin/perl +=head1 NAME +perl.pl + +=head1 VERSION + +same with App::Virtualenv + +=head1 SYNOPSIS + +runs Perl language interpreter under Perl virtual environment + +C<[I/bin/]perl.pl [I]...> + +=cut use strict; use warnings; no warnings qw(qw utf8); @@ -11,3 +25,25 @@ exit App::Virtualenv::perl(undef, @ARGV); +=head1 AUTHOR + +Orkun Karaduman + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2016 Orkun Karaduman + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +=cut diff --git a/lib/App/Virtualenv/sh.pl b/lib/App/Virtualenv/sh.pl index d1edeb6..aff5efd 100755 --- a/lib/App/Virtualenv/sh.pl +++ b/lib/App/Virtualenv/sh.pl @@ -1,5 +1,19 @@ #! /usr/bin/perl +=head1 NAME +sh.pl + +=head1 VERSION + +same with App::Virtualenv + +=head1 SYNOPSIS + +runs Unix shell under Perl virtual environment + +C<[I/bin/]sh.pl> + +=cut use strict; use warnings; no warnings qw(qw utf8); @@ -11,3 +25,25 @@ exit App::Virtualenv::sh(undef, @ARGV); +=head1 AUTHOR + +Orkun Karaduman + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2016 Orkun Karaduman + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +=cut diff --git a/lib/App/Virtualenv/shell.pl b/lib/App/Virtualenv/shell.pl index cb908a8..c8cf5ed 100755 --- a/lib/App/Virtualenv/shell.pl +++ b/lib/App/Virtualenv/shell.pl @@ -1,5 +1,19 @@ #! /usr/bin/perl +=head1 NAME +shell.pl + +=head1 VERSION + +same with App::Virtualenv + +=head1 SYNOPSIS + +runs Perl shell interpreter under Perl virtual environment + +C<[I/bin/]shell.pl> + +=cut use strict; use warnings; no warnings qw(qw utf8); @@ -11,3 +25,25 @@ exit App::Virtualenv::shell(undef, @ARGV); +=head1 AUTHOR + +Orkun Karaduman + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2016 Orkun Karaduman + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +=cut diff --git a/lib/App/Virtualenv/virtualenv.pl b/lib/App/Virtualenv/virtualenv.pl index 2bc15ea..3d77e3c 100755 --- a/lib/App/Virtualenv/virtualenv.pl +++ b/lib/App/Virtualenv/virtualenv.pl @@ -1,5 +1,19 @@ #! /usr/bin/perl +=head1 NAME +virtualenv.pl + +=head1 VERSION + +same with App::Virtualenv + +=head1 SYNOPSIS + +creates new Perl virtual environment + +C]> + +=cut use strict; use warnings; no warnings qw(qw utf8); @@ -12,3 +26,25 @@ my ($virtualenv) = @ARGV; exit not App::Virtualenv::create($virtualenv); +=head1 AUTHOR + +Orkun Karaduman + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2016 Orkun Karaduman + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +=cut diff --git a/tests.pl b/tests.pl index eb22a42..3fc59a4 100755 --- a/tests.pl +++ b/tests.pl @@ -1,5 +1,17 @@ #! /usr/bin/perl +=head1 NAME +tests.pl + +=head1 VERSION + +same with App::Virtualenv + +=head1 USAGE + +B> + +=cut use strict; use warnings; no warnings qw(qw utf8); @@ -14,3 +26,25 @@ App::Virtualenv::Module::list(); exit 0; +=head1 AUTHOR + +Orkun Karaduman + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2016 Orkun Karaduman + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +=cut From 58dbef7bebfbaba57ab05d29b6af9a926d2bc237 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 13:16:02 +0300 Subject: [PATCH 07/12] README test --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5e7dae..ae7e4d3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ perl5-virtualenv is a tool to create isolated Perl 5 virtual environments, like creates new Perl virtual environment -**virtualenv.pl [*environment_path*]** +`virtualenv.pl [*environment_path*]` ### sh.pl From 28b175b0e081bdd993daaab3304dc62a9337db9b Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 13:16:59 +0300 Subject: [PATCH 08/12] README test --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ae7e4d3..f6c50a3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ perl5-virtualenv is a tool to create isolated Perl 5 virtual environments, like creates new Perl virtual environment -`virtualenv.pl [*environment_path*]` +> virtualenv.pl [*environment_path*] ### sh.pl From cbacbdeac7ae01d7a8e580afda3eab2509fd58e0 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 13:18:34 +0300 Subject: [PATCH 09/12] README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f6c50a3..c0cf051 100644 --- a/README.md +++ b/README.md @@ -15,31 +15,31 @@ creates new Perl virtual environment runs Unix shell under Perl virtual environment -**[*environment_path*/bin/]sh.pl** +> [*environment_path*/bin/]sh.pl ### perl.pl runs Perl language interpreter under Perl virtual environment -**[*environment_path*/bin/]perl.pl [*argument*]...** +> [*environment_path*/bin/]perl.pl [*argument*]... ### shell.pl runs Perl shell interpreter under Perl virtual environment -**[*environment_path*/bin/]shell.pl** +> [*environment_path*/bin/]shell.pl ### activate activates Perl virtual environment -**source *environment_path*/bin/activate** +> source *environment_path*/bin/activate ### deactivate -deactivates Perl virtual environment +deactivates activated Perl virtual environment -**deactivate** +> deactivate ## INSTALLATION From 1e601804642ac980608f2277f6d8a236c7199319 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 13:26:10 +0300 Subject: [PATCH 10/12] README & pod changes --- README.md | 6 +++++- lib/App/Virtualenv.pm | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c0cf051..f08ec84 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ deactivates activated Perl virtual environment ## INSTALLATION -To install this module type the following: +To install this module type the following > perl Makefile.PL > @@ -53,6 +53,10 @@ To install this module type the following: > > make install +from CPAN + +> cpan App::Virtualenv + ## DEPENDENCIES This module requires these other modules and libraries: diff --git a/lib/App/Virtualenv.pm b/lib/App/Virtualenv.pm index b367543..d5cefda 100644 --- a/lib/App/Virtualenv.pm +++ b/lib/App/Virtualenv.pm @@ -9,7 +9,7 @@ version 1.03 =head1 SYNOPSIS - +Perl 5 virtual environment module. =cut use strict; From 9a256795f49740b5ead976b7056e8e4d6f20a189 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 13:27:05 +0300 Subject: [PATCH 11/12] README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f08ec84..01c7080 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ To install this module type the following from CPAN -> cpan App::Virtualenv +> cpan -i App::Virtualenv ## DEPENDENCIES From 2b6c7839ce82f906e69372c9b0dff6a572d468fa Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Mon, 28 Nov 2016 13:36:54 +0300 Subject: [PATCH 12/12] Makefile.PL META_MERGE --- Makefile.PL | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile.PL b/Makefile.PL index 69ccc5b..43f8e67 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,4 +13,14 @@ WriteMakefile( AUTHOR => 'Orkun Karaduman ', ABSTRACT => 'Virtual environment for Perl 5', LICENSE => 'gpl_3', + META_MERGE => { + "meta-spec" => { version => 2 }, + resources => { + repository => { + type => 'git', + url => 'git://git@github.com:orkunkaraduman/perl5-virtualenv.git', + web => 'https://github.com/orkunkaraduman/perl5-virtualenv', + }, + }, + }, );