Skip to content

Commit

Permalink
Merge pull request #24 from orkunkaraduman/dev
Browse files Browse the repository at this point in the history
v1.11
  • Loading branch information
orkunkaraduman authored Dec 15, 2016
2 parents bdd55bc + 96b188c commit baa6aaf
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 101 deletions.
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.11 2016-12-15
- App::Virtualenv::Module::inPerLib() fix
- App::Virtualenv::activate2() added
- Perl v5.14 for all modules

1.10 2016-12-10
- Version, POD and README fixes for v1.09
- Improved local library and Perl library module checks
Expand Down
1 change: 0 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use strict;
use warnings;
use v5.10;
use ExtUtils::MakeMaker;


Expand Down
24 changes: 1 addition & 23 deletions README
Original file line number Diff line number Diff line change
@@ -1,91 +1,74 @@
NAME

App::Virtualenv - Perl virtual environment

VERSION

version 1.10
version 1.11

SYNOPSIS

Perl virtual environment

DESCRIPTION

App::Virtualenv is a Perl package to create isolated Perl virtual
environments, like Python virtual environment.

USAGE

virtualenv.pl

creates new Perl virtual environment

virtualenv.pl [*environment_path*]

activate

activates Perl virtual environment

source *environment_path*/bin/activate

deactivate

deactivates activated Perl virtual environment

deactivate

sh.pl

runs Unix shell under Perl virtual environment

[*environment_path*/bin/]sh.pl [*argument*]...

perl.pl

runs Perl language interpreter under Perl virtual environment

[*environment_path*/bin/]perl.pl [*argument*]...

piv.pl

Perl in Virtual environment

[*environment_path*/bin/]piv.pl [-*argument*]... [--*argument*
*value*]... *command* [*parameter*]...

Commands

piv virtualenv

creates new Perl virtual environment

piv virtualenv [-e] [*environment_path*]

-e Empty virtual environment

piv sh

runs Unix shell under Perl virtual environment

[*environment_path*/bin/]piv sh [*argument*]...

piv perl

runs Perl language interpreter under Perl virtual environment

[*environment_path*/bin/]piv perl [*argument*]...

piv list

lists installed packages under Perl virtual environment

[*environment_path*/bin/]piv list [-1]

-1 One column list

piv install

installs or upgrades packages under Perl virtual environment

[*environment_path*/bin/]piv install [-f] [-t] [-s] [-v]
Expand All @@ -100,7 +83,6 @@ USAGE
-v Verbose

piv remove

removes packages under Perl virtual environment

[*environment_path*/bin/]piv remove [-f] [-v] *package*...
Expand All @@ -110,7 +92,6 @@ USAGE
-v Verbose

INSTALLATION

To install this module type the following

perl Makefile.PL
Expand All @@ -123,7 +104,6 @@ INSTALLATION
cpan -i App::Virtualenv

DEPENDENCIES

This module requires these other modules and libraries:

* local::lib
Expand All @@ -143,11 +123,9 @@ DEPENDENCIES
* CPANPLUS

AUTHOR

Orkun Karaduman <orkunkaraduman@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2016 Orkun Karaduman <orkunkaraduman@gmail.com>

This program is free software: you can redistribute it and/or modify it
Expand Down
24 changes: 1 addition & 23 deletions README.cl
Original file line number Diff line number Diff line change
@@ -1,91 +1,74 @@
NAME

App::Virtualenv - Perl virtual environment

VERSION

version 1.10
version 1.11

SYNOPSIS

Perl virtual environment

DESCRIPTION

App::Virtualenv is a Perl package to create isolated Perl virtual
environments, like Python virtual environment.

USAGE

virtualenv.pl

creates new Perl virtual environment

virtualenv.pl [environment_path]

activate

activates Perl virtual environment

source environment_path/bin/activate

deactivate

deactivates activated Perl virtual environment

deactivate

sh.pl

runs Unix shell under Perl virtual environment

[environment_path/bin/]sh.pl [argument]...

perl.pl

runs Perl language interpreter under Perl virtual environment

[environment_path/bin/]perl.pl [argument]...

piv.pl

Perl in Virtual environment

[environment_path/bin/]piv.pl [-argument]... [--argument value]...
command [parameter]...

Commands

piv virtualenv

creates new Perl virtual environment

piv virtualenv [-e] [environment_path]

-e Empty virtual environment

piv sh

runs Unix shell under Perl virtual environment

[environment_path/bin/]piv sh [argument]...

piv perl

runs Perl language interpreter under Perl virtual environment

[environment_path/bin/]piv perl [argument]...

piv list

lists installed packages under Perl virtual environment

[environment_path/bin/]piv list [-1]

-1 One column list

piv install

installs or upgrades packages under Perl virtual environment

[environment_path/bin/]piv install [-f] [-t] [-s] [-v] package...
Expand All @@ -99,7 +82,6 @@
-v Verbose

piv remove

removes packages under Perl virtual environment

[environment_path/bin/]piv remove [-f] [-v] package...
Expand All @@ -109,7 +91,6 @@
-v Verbose

INSTALLATION

To install this module type the following

perl Makefile.PL
Expand All @@ -122,7 +103,6 @@
cpan -i App::Virtualenv

DEPENDENCIES

This module requires these other modules and libraries:

* local::lib
Expand All @@ -142,11 +122,9 @@
* CPANPLUS

AUTHOR

Orkun Karaduman <orkunkaraduman@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2016 Orkun Karaduman <orkunkaraduman@gmail.com>

This program is free software: you can redistribute it and/or modify it
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ App::Virtualenv - Perl virtual environment

# VERSION

version 1.10
version 1.11

# SYNOPSIS

Expand Down
12 changes: 3 additions & 9 deletions bin/test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ =head1 SYNOPSIS
use strict;
use warnings;
no warnings qw(qw utf8);
use v5.10;
use open qw(:std :locale);
use v5.14;
use utf8;
use open qw(:std :locale);
use Config;
use FindBin;
use Data::Dumper;
Expand All @@ -29,13 +29,7 @@ =head1 SYNOPSIS
use App::Virtualenv::Piv;


my $inst = ExtUtils::Installed->new;
my @a = $inst->directory_tree("Net::Twitter", "all");
say Dumper(\@a);
exit;
#exit App::Virtualenv::Module::install(force => 1, modules => ['ExtUtils::Installed']);
#exit App::Virtualenv::Piv::main(@ARGV);
#exit App::Virtualenv::perl("-I${FindBin::Bin}/../lib", "-MApp::Virtualenv::Module", "-e exit App::Virtualenv::Module::${ARGV[0]}('${ARGV[1]}');");
exit 0;
__END__
=head1 AUTHOR
Expand Down
22 changes: 18 additions & 4 deletions lib/App/Virtualenv.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ App::Virtualenv - Perl virtual environment
=head1 VERSION
version 1.10
version 1.11
=head1 SYNOPSIS
Expand Down Expand Up @@ -228,7 +228,7 @@ CPANPLUS
use strict;
use warnings;
no warnings qw(qw utf8);
use v5.10;
use v5.14;
use utf8;
use Config;
use FindBin;
Expand All @@ -242,7 +242,7 @@ BEGIN
{
require Exporter;
# set the version for version checking
our $VERSION = '1.10';
our $VERSION = '1.11';
# Inherit from Exporter to export functions and variables
our @ISA = qw(Exporter);
# Functions and variables which are exported by default
Expand Down Expand Up @@ -281,11 +281,25 @@ sub activate
$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;
}

sub activate2
{
my $oldVirtualenvPath = getVirtualenvPath();
my $virtualenvPath = activate();
if (defined $virtualenvPath)
{
say STDERR "Perl virtual environment path: $virtualenvPath" if not defined $oldVirtualenvPath or $oldVirtualenvPath ne $virtualenvPath;
} else
{
say STDERR "Perl virtual environment is not activated";
}
return $virtualenvPath;
}

sub deactivate
{
my ($nondestructive) = @_;
Expand Down
Loading

0 comments on commit baa6aaf

Please sign in to comment.