Skip to content

Commit

Permalink
rewrite docs to mention cpanfile rather than Makefile.PL/Build.PL
Browse files Browse the repository at this point in the history
  • Loading branch information
miyagawa committed Apr 12, 2012
1 parent 2bdd1d7 commit 65b4a6c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 78 deletions.
29 changes: 5 additions & 24 deletions README
Expand Up @@ -3,18 +3,12 @@ NAME

SYNOPSIS
# On your development environment
> cat Makefile.PL
use inc::Module::Install;
name 'MyApp';
version '1.0';

> cat cpanfile
requires 'Plack', 0.9980;
requires 'Starman', 0.2000;

WriteAll;

> carton install
> git add Makefile.PL carton.lock
> git add cpanfile carton.lock
> git commit -m "add Plack and Starman"

# Other developer's machine, or on a deployment box
Expand Down Expand Up @@ -46,15 +40,11 @@ TUTORIAL
> 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*.
You can manage the dependencies of your application via *cpanfile*.

# Makefile.PL
use inc::Module::Install;
name 'MyAwesomeApp';
# cpanfile
requires 'Plack', 0.9980;
requires 'Starman', 0.2000;
WriteAll;

And then you can install these dependencies via:

Expand All @@ -69,18 +59,9 @@ TUTORIAL
other developers on your app, as well as your deployment environment,
use exactly the same versions of the modules you just installed.

> git add Makefile.PL carton.lock
> git add cpanfile carton.lock
> git commit -m "Added Plack and Starman"

You can aternatively install modules adhoc from the command line,
without managing the build file at all.

> carton install Devel::NYTProf
> carton install AnyEvent::Redis

carton will install these modules into *local* directory in the same
way, and also can track and analyze the dependencies.

Deploying your application
Once you've done installing all the dependencies, you can push your
application directory to a remote machine (excluding *local* and
Expand Down
29 changes: 5 additions & 24 deletions lib/Carton.pod
Expand Up @@ -5,18 +5,12 @@ Carton - Perl module dependency manager (aka Bundler for Perl)
=head1 SYNOPSIS

# On your development environment
> cat Makefile.PL
use inc::Module::Install;
name 'MyApp';
version '1.0';

> cat cpanfile
requires 'Plack', 0.9980;
requires 'Starman', 0.2000;

WriteAll;

> carton install
> git add Makefile.PL carton.lock
> git add cpanfile carton.lock
> git commit -m "add Plack and Starman"

# Other developer's machine, or on a deployment box
Expand Down Expand Up @@ -53,15 +47,11 @@ exclude these directories from the version control system.

=head2 Tracking the dependencies

You can manage the dependencies of your application via the standard
I<Makefile.PL> or I<Build.PL>.
You can manage the dependencies of your application via I<cpanfile>.

# Makefile.PL
use inc::Module::Install;
name 'MyAwesomeApp';
# cpanfile
requires 'Plack', 0.9980;
requires 'Starman', 0.2000;
WriteAll;

And then you can install these dependencies via:

Expand All @@ -76,18 +66,9 @@ and commit changes as you update dependencies. This will ensure that
other developers on your app, as well as your deployment environment,
use exactly the same versions of the modules you just installed.

> git add Makefile.PL carton.lock
> git add cpanfile carton.lock
> git commit -m "Added Plack and Starman"

You can aternatively install modules adhoc from the command line,
without managing the build file at all.

> carton install Devel::NYTProf
> carton install AnyEvent::Redis

carton will install these modules into I<local> directory in the same
way, and also can track and analyze the dependencies.

=head2 Deploying your application

Once you've done installing all the dependencies, you can push your
Expand Down
17 changes: 8 additions & 9 deletions lib/Carton/Doc/Check.pod
@@ -1,21 +1,20 @@
=head1 NAME

Carton::Doc::Check - Check if your build file and local environment are in sync
Carton::Doc::Check - Check if your cpanfile and local environment are in sync

=head1 SYNOPSIS

carton check

=head1 DESCRIPTION

This command checks the consisntency between yoru build file and the
This command checks the consisntency between yoru cpanfile and the
local environment.

=head2 MISSING MODULES

If one of the modules specified in your build file such as
I<Makefile.PL> are not found in your local environment, C<carton check>
will warn you about this:
If one of the modules specified in your I<cpanfile> are not found in
your local environment, C<carton check> will warn you about this:

$ carton check
Following dependencies are not satisfied. Run `carton install` to install them.
Expand All @@ -26,17 +25,17 @@ You can run C<carton install> again to reinstall these missing dependencies.
=head2 UNUSED MODULES

If one of the modules in the local environment (i.e. I<local> library
path) are not specified in your build file, you'll get a warning like
path) are not specified in your I<cpanfile>, you'll get a warning like
this:

$ carton check
Following modules are found in local but couldn't be tracked from your Makefile.PL
Following modules are found in local but couldn't be tracked from your cpanfile
CGI.pm-3.55
FCGI-0.73

This means you probably installed this module in an ad-hoc mode so you
have to add it to I<Makefile.PL>, or you originally declared the
have to add it to I<cpanfile>, or you originally declared the
dependencies but found out that you don't need it, so deleted from
your build file. In that case you can uninstall the module with the
your I<cpanfile>. In that case you can uninstall the module with the
L<uninstall|Plack::Doc::Uninstall> command.

4 changes: 2 additions & 2 deletions lib/Carton/Doc/FAQ.pod
Expand Up @@ -10,8 +10,8 @@ The particular problem that carton is trying to address is this:

You develop a Perl web application with dozens of CPAN module
dependencies. You install these modules on your development machine,
and describe these dependencies in your Makefile.PL or some other text
format.
and describe these dependencies in your I<Makefile.PL> or some other
text format.

Now you get a produciton environment on Cloud PaaS provider or some
VPS, you install the dependencies using C<cpanm --installdeps .> and
Expand Down
34 changes: 15 additions & 19 deletions lib/Carton/Doc/Install.pod
Expand Up @@ -15,16 +15,11 @@ modes and the behavior is slightly different.

=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> without any arguments and if a build file
(I<Makefile.PL> or I<Build.PL>) exists, carton will scan dependencies
from the build file and install the modules.
If you run C<carton install> without any arguments and if I<cpanfile>
exists, carton will scan dependencies from I<cpanfile> and install
the modules.

=back

Expand All @@ -34,9 +29,8 @@ modules specified, resolve dependencies and install all required
modules from CPAN.

If I<carton.lock> file does exist, carton will still try to install
modules specified or updated in the build file, but uses
I<carton.lock> for the dependency resolution, and then cascades to
CPAN.
modules specified or updated in I<cpanfile>, but uses I<carton.lock>
for the dependency resolution, and then cascades to CPAN.

carton will analyze all the dependencies and their version
information, and it is saved into I<carton.lock> file. It is important
Expand All @@ -46,7 +40,7 @@ commit the changes as you update your dependencies.
=head2 DEPLOYMENT MODE

If you specify the C<--deployment> command line option or the
I<carton.lock> exists and your build file does not exist, carton will
I<carton.lock> exists and I<cpanfile> does not exist, carton will
fetch all remote modules and use the dependencies specified in the
I<carton.lock> instead of resolving dependencies.

Expand All @@ -67,15 +61,17 @@ C<carton install URI> again:
You have URI (1.50)

because you haven't specified the version number, carton won't update
the module in your local library path. If you want to update to the
latest version of CPAN, you can either use C<carton update> command,
or specify the required version either in your build file or a command
line argument:
the module in your local library path.

B<WARNINGS: following commands are not implemented>

If you want to update to the latest version of CPAN, you can either
use C<carton update> command, or specify the required version either
in your I<cpanfile>.

> carton install URI~1.51
> carton update URI

> cat Makefile.PL
> cat cpanfile
requires 'URI', 1.51;

Any of those will upgrade URI to the latest one from CPAN, and the
Expand All @@ -87,7 +83,7 @@ version specified in the I<carton.lock> will be bumped.

=item --deployment

Force the deployment mode and carton will ignore build file contents.
Force the deployment mode and carton will ignore I<cpanfile> contents.

=item --path

Expand Down

0 comments on commit 65b4a6c

Please sign in to comment.