This is an automated email from the git hooks/post-receive script. kanashiro-guest pushed a commit to branch master in repository carton.
commit d3ea4e09c5be4d441f1cb14563e6d05f8b2aceef Author: Tatsuhiko Miyagawa <[email protected]> Date: Sat Jun 25 23:42:33 2011 -0700 reorganized the command and docs --- Makefile.PL | 17 +++- README | 115 ---------------------------- TODO | 1 + bin/carton | 132 -------------------------------- lib/Carton.pm | 26 ++++++- bin/carton => lib/Carton/Doc/Carton.pod | 9 --- lib/Carton/Doc/Install.pod | 60 +++++++++++++++ 7 files changed, 100 insertions(+), 260 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index 9d3e281..85833e5 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,7 +1,8 @@ use inc::Module::Install; name 'carton'; version_from 'lib/Carton.pm'; -all_from 'bin/carton'; +perl_version '5.008001'; +license_from 'lib/Carton/Doc/Carton.pod'; readme_from('bin/carton'); requires 'version', 0.77; @@ -12,7 +13,21 @@ requires 'Module::Metadata', 1.000003; install_script 'bin/carton'; +makemaker_args MAN1PODS => man1pods(); + build_requires 'Test::More', 0.88; test_requires 'Test::Requires'; auto_set_repository(); WriteAll; + +sub man1pods { + my %pods; + + for my $file (glob "lib/Carton/Doc/*.pod") { + my $name = ($file =~ m!Doc/(.*?)\.pod!)[0]; + $name = $name eq 'Carton' ? "carton" : ("carton-" . lc($name)); + $pods{$file} = "blib/man1/$name.1" + } + + \%pods; +} diff --git a/README b/README index 9ff924f..e69de29 100644 --- a/README +++ b/README @@ -1,115 +0,0 @@ -NAME - carton - Perl module dependency manager (aka Bundler for Perl) - -SYNOPSIS - # During the development - > $EDITOR Makefile.PL - ... - requires 'Plack', 0.9980; - requires 'Starman', 0.2000; - ... - - > carton install - > git commit -m "add Plack and Starman" Makefile.PL carton.lock - - # Then elsewhere (on a deployment machine) - > carton install - > carton exec starman -p 8080 myapp.psgi - -WARNING - This software is under the heavy development and considered ALPHA - quality till the version hits v1.0.0. Things might be broken, not all - features have been implemented, and APIs will be likely to change. YOU - HAVE BEEN WARNED. - -DESCRIPTION - carton is a command line tool to track the Perl module dependencies for - your Perl application. - -TUTORIAL - Initializing the environment - carton will use ".carton" folder for local configuration and "local" to - install modules. You're recommended to exclude these directories from - the version control system. - - > carton check - > echo .carton >> .gitignore - > echo local/ >> .gitignore - > git add carton.lock - > git commit -m "Start using carton" - - Tracking the dependencies - You can manage the dependencies of your application via the standard - "Makefile.PL" or "Build.PL". - - # Makefile.PL - use inc::Module::Install; - name 'MyAwesomeApp'; - requires 'Plack', 0.9980; - requires 'Starman', 0.2000; - WriteAll; - - And then you can install these dependencies via: - - > carton install - - The modules are installed into your "local" directory, and the - dependencies tree and version information are analyzed and saved into - "carton.lock" in your directory. - - Make sure you add "carton.lock" to your version controlled repository - and commit changes as you update dependencies. - - > git commit -m "Added Plack and Starman" Makefile.PL carton.lock - - You'll alternatively be able to install modules from the command line, - without managing the build file at all. - - Deploying your application - Once you've done installing all the dependencies, you can push your - application directory to a remote machine (excluding "local" and - ".carton") and run the following command: - - > carton install - - This will look at the "carton.lock" and install the exact same versions - of the dependencies into "local", and now your application is ready to - run. - - Bundling modules - carton can bundle all the tarballs for your dependencies into a - directory so that you can even install dependencies that are not - available on CPAN, such as internal distribution aka DarkPAN. - - > carton bundle - - will bundle these tarballs into "local/cache" directory, and - - > carton install --cached - - will install modules using this local cache. This way you can avoid a - dependency on CPAN meta DB and search.cpan.org at a deploy time, or you - can have dependencies onto private CPAN modules aka DarkPAN. - -AUTHOR - Tatsuhiko Miyagawa - -COPYRIGHT - Tatsuhiko Miyagawa 2011- - -LICENSE - This software is licensed under the same terms as Perl itself. - -SEE ALSO - cpanm - - Bundler <http://gembundler.com/> - - pip <http://pypi.python.org/pypi/pip> - - npm <http://npmjs.org/> - - perlrocks <https://github.com/gugod/perlrocks> - - only - diff --git a/TODO b/TODO index a7affb5..cbe9c8d 100644 --- a/TODO +++ b/TODO @@ -3,6 +3,7 @@ support CPAN distro only carton config / .carton/config -g, --global + local::lib (~/perl5) exec +cpanm Module@Version # 1.1 carton update diff --git a/bin/carton b/bin/carton index 3212f5c..d72a74c 100755 --- a/bin/carton +++ b/bin/carton @@ -4,135 +4,3 @@ use 5.008001; use Carton; Carton->new->run(@ARGV); - -__END__ - -=head1 NAME - -carton - Perl module dependency manager (aka Bundler for Perl) - -=head1 SYNOPSIS - - # During the development - > $EDITOR Makefile.PL - ... - requires 'Plack', 0.9980; - requires 'Starman', 0.2000; - ... - - > carton install - > git commit -m "add Plack and Starman" Makefile.PL carton.lock - - # Then elsewhere (on a deployment machine) - > carton install - > carton exec starman -p 8080 myapp.psgi - -=head1 WARNING - -B<This software is under the heavy development and considered ALPHA -quality till the version hits v1.0.0. Things might be broken, not all -features have been implemented, and APIs will be likely to change. YOU -HAVE BEEN WARNED.> - -=head1 DESCRIPTION - -carton is a command line tool to track the Perl module dependencies -for your Perl application. - -=head1 TUTORIAL - -=head2 Initializing the environment - -carton will use C<.carton> folder for local configuration and -C<local> to install modules. You're recommended to exclude these -directories from the version control system. - - > carton check - > echo .carton >> .gitignore - > echo local/ >> .gitignore - > git add carton.lock - > git commit -m "Start using carton" - -=head2 Tracking the dependencies - -You can manage the dependencies of your application via the standard -C<Makefile.PL> or C<Build.PL>. - - # Makefile.PL - use inc::Module::Install; - name 'MyAwesomeApp'; - requires 'Plack', 0.9980; - requires 'Starman', 0.2000; - WriteAll; - -And then you can install these dependencies via: - - > carton install - -The modules are installed into your C<local> directory, and the -dependencies tree and version information are analyzed and saved into -C<carton.lock> in your directory. - -Make sure you add C<carton.lock> to your version controlled -repository and commit changes as you update dependencies. - - > git commit -m "Added Plack and Starman" Makefile.PL carton.lock - -You'll alternatively be able to install modules from the command line, -without managing the build file at all. - -=head2 Deploying your application - -Once you've done installing all the dependencies, you can push your -application directory to a remote machine (excluding C<local> and -C<.carton>) and run the following command: - - > carton install - -This will look at the C<carton.lock> and install the exact same -versions of the dependencies into C<local>, and now your application -is ready to run. - -=head2 Bundling modules - -carton can bundle all the tarballs for your dependencies into a -directory so that you can even install dependencies that are not -available on CPAN, such as internal distribution aka DarkPAN. - - > carton bundle - -will bundle these tarballs into C<local/cache> directory, and - - > carton install --cached - -will install modules using this local cache. This way you can avoid a -dependency on CPAN meta DB and search.cpan.org at a deploy time, or -you can have dependencies onto private CPAN modules aka DarkPAN. - -=head1 AUTHOR - -Tatsuhiko Miyagawa - -=head1 COPYRIGHT - -Tatsuhiko Miyagawa 2011- - -=head1 LICENSE - -This software is licensed under the same terms as Perl itself. - -=head1 SEE ALSO - -L<cpanm> - -L<Bundler|http://gembundler.com/> - -L<pip|http://pypi.python.org/pypi/pip> - -L<npm|http://npmjs.org/> - -L<perlrocks|https://github.com/gugod/perlrocks> - -L<only> - -=cut diff --git a/lib/Carton.pm b/lib/Carton.pm index 48e100c..8bdf018 100644 --- a/lib/Carton.pm +++ b/lib/Carton.pm @@ -52,7 +52,7 @@ sub run { push @commands, @ARGV; - my $cmd = shift @commands || 'help'; + my $cmd = shift @commands || 'usage'; my $call = $self->can("cmd_$cmd"); if ($call) { @@ -62,6 +62,26 @@ sub run { } } +sub commands { + my $self = shift; + + no strict 'refs'; + map { s/^cmd_//; $_ } + grep /^cmd_(.*)/, sort keys %{__PACKAGE__."::"}; +} + +sub cmd_usage { + my $self = shift; + print <<HELP; +Usage: carton <command> + +where <command> is one of: + @{[ join ", ", $self->commands ]} + +Run carton -h <command> for help. +HELP +} + sub parse_options { my($self, $args, @spec) = @_; Getopt::Long::GetOptionsFromArray($args, @spec); @@ -87,8 +107,8 @@ sub error { sub cmd_help { my $self = shift; - my $cmd = $_[0] ? "carton-$_[0]" : "carton"; - system "perldoc", $cmd; + my $module = "Carton::Doc::" . ($_[0] ? ucfirst $_[0] : "Carton"); + system "perldoc", $module; } sub cmd_version { diff --git a/bin/carton b/lib/Carton/Doc/Carton.pod old mode 100755 new mode 100644 similarity index 97% copy from bin/carton copy to lib/Carton/Doc/Carton.pod index 3212f5c..934df6d --- a/bin/carton +++ b/lib/Carton/Doc/Carton.pod @@ -1,12 +1,3 @@ -#!perl -use strict; -use 5.008001; -use Carton; - -Carton->new->run(@ARGV); - -__END__ - =head1 NAME carton - Perl module dependency manager (aka Bundler for Perl) diff --git a/lib/Carton/Doc/Install.pod b/lib/Carton/Doc/Install.pod new file mode 100644 index 0000000..4a25edf --- /dev/null +++ b/lib/Carton/Doc/Install.pod @@ -0,0 +1,60 @@ +=head1 NAME + +carton-install - Install the dependencies + +=head1 SYNOPSIS + + carton install [--deployment] [--path=PATH] [modules...] + +=head1 DESCRIPTION + +Install the dependencies for your application. This command has two +modes and the behavior is slightly different. + +=head2 DEVELOPMENT MODE + +=over 4 + +=item carton install <name> + +If you run C<carton install> with the arguments, carton will fetch and +install the modules given as arguments. + +=item carton install (no arguments) + +If you run C<carton install> for the first itme, or your build file +(C<Makefile.PL or C<Build.PL>) is updated (i.e. its modification time +is newer than C<carton.lock> file), carton will fetch all the +dependencies specified in your build file, resolve dependencies and +install all required modules. + +=back + +In the development mode, carton will analyze all the dependencies and +their version information, and it is saved into C<carton.lock> +file. It is important to add C<carton.lock> file into a version +controlled repository and commit the changes as you update your +dependencies. + +=head2 DEPLOYMENT MODE + +If you specify the C<--deployment> command line option or your +C<carton.lock> exists and is newer than your build file, carton will +fetch all remote modules and use the dependencies specified in the +C<carton.lock> instead of resolving dependencies. + +=back + +=head1 OPTIONS + +=over 4 + +=item --deployment + +Force the deployment mode and carton will ignore build file contents. + +=item --path + +Specify the path to install modules to. Defaults to C<local> in the current directory. + +=back -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/carton.git _______________________________________________ Pkg-perl-cvs-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits
