summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiko Miyagawa <miyagawa@bulknews.net>2011-06-25 22:36:37 -0700
committerTatsuhiko Miyagawa <miyagawa@bulknews.net>2011-06-25 22:36:37 -0700
commitd2d9a68e5d7b4f2055a31c39cf0c2ceda207924c (patch)
treeffd5a44d2d75a331a894cff312c3fa5701d9f1c0
parent807b1430a6068380b2ac2763a3106239002e9bee (diff)
downloadcarton-d2d9a68e5d7b4f2055a31c39cf0c2ceda207924c.tar.gz
rename carton.json to carton.lock to make it obvious
-rw-r--r--.gitignore2
-rw-r--r--MANIFEST.SKIP2
-rw-r--r--README12
-rwxr-xr-xbin/carton12
-rw-r--r--lib/Carton.pm24
5 files changed, 24 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index e116d1a..570095e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,5 +4,3 @@ Makefile
inc/
pm_to_blib
*~
-extlib/
-carton.json
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
index 5f8714b..0ef102f 100644
--- a/MANIFEST.SKIP
+++ b/MANIFEST.SKIP
@@ -13,5 +13,3 @@
\.cvsignore
\.shipit
MYMETA
-extlib
-carton.json
diff --git a/README b/README
index 87f1ac5..9ff924f 100644
--- a/README
+++ b/README
@@ -10,7 +10,7 @@ SYNOPSIS
...
> carton install
- > git commit -m "add Plack and Starman" Makefile.PL carton.json
+ > git commit -m "add Plack and Starman" Makefile.PL carton.lock
# Then elsewhere (on a deployment machine)
> carton install
@@ -35,7 +35,7 @@ TUTORIAL
> carton check
> echo .carton >> .gitignore
> echo local/ >> .gitignore
- > git add carton.json
+ > git add carton.lock
> git commit -m "Start using carton"
Tracking the dependencies
@@ -55,12 +55,12 @@ TUTORIAL
The modules are installed into your "local" directory, and the
dependencies tree and version information are analyzed and saved into
- "carton.json" in your directory.
+ "carton.lock" in your directory.
- Make sure you add "carton.json" to your version controlled repository
+ 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.json
+ > 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.
@@ -72,7 +72,7 @@ TUTORIAL
> carton install
- This will look at the "carton.json" and install the exact same versions
+ 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.
diff --git a/bin/carton b/bin/carton
index beb605f..3212f5c 100755
--- a/bin/carton
+++ b/bin/carton
@@ -21,7 +21,7 @@ carton - Perl module dependency manager (aka Bundler for Perl)
...
> carton install
- > git commit -m "add Plack and Starman" Makefile.PL carton.json
+ > git commit -m "add Plack and Starman" Makefile.PL carton.lock
# Then elsewhere (on a deployment machine)
> carton install
@@ -50,7 +50,7 @@ directories from the version control system.
> carton check
> echo .carton >> .gitignore
> echo local/ >> .gitignore
- > git add carton.json
+ > git add carton.lock
> git commit -m "Start using carton"
=head2 Tracking the dependencies
@@ -71,12 +71,12 @@ And then you can install these dependencies via:
The modules are installed into your C<local> directory, and the
dependencies tree and version information are analyzed and saved into
-C<carton.json> in your directory.
+C<carton.lock> in your directory.
-Make sure you add C<carton.json> to your version controlled
+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.json
+ > 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.
@@ -89,7 +89,7 @@ C<.carton>) and run the following command:
> carton install
-This will look at the C<carton.json> and install the exact same
+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.
diff --git a/lib/Carton.pm b/lib/Carton.pm
index 7b5b958..48e100c 100644
--- a/lib/Carton.pm
+++ b/lib/Carton.pm
@@ -108,11 +108,11 @@ sub cmd_install {
$self->print("Installing modules using $file\n");
$self->install_from_build_file($file);
$self->update_packages;
- } elsif (-e 'carton.json') {
- $self->print("Installing modules using carton.json\n");
+ } elsif (-e 'carton.lock') {
+ $self->print("Installing modules using carton.lock\n");
$self->install_from_spec();
} else {
- $self->error("Can't locate build file or carton.json\n");
+ $self->error("Can't locate build file or carton.lock\n");
}
$self->print("Complete! Modules were installed into $self->{path}\n", "SUCCESS");
@@ -121,13 +121,13 @@ sub cmd_install {
sub has_build_file {
my $self = shift;
- # deployment mode ignores build files and only uses carton.json
+ # deployment mode ignores build files and only uses carton.lock
return if $self->{deployment};
my $file = (grep -e, qw( Build.PL Makefile.PL ))[0]
or return;
- if ($self->mtime($file) > $self->mtime("carton.json")) {
+ if ($self->mtime($file) > $self->mtime("carton.lock")) {
return $file;
}
@@ -154,8 +154,8 @@ sub install_modules {
sub install_from_spec {
my $self = shift;
- my $data = $self->parse_json('carton.json')
- or $self->error("Couldn't parse carton.json: Remove the file and run `carton install` to rebuild it.\n");
+ my $data = $self->parse_json('carton.lock')
+ or $self->error("Couldn't parse carton.lock: Remove the file and run `carton install` to rebuild it.\n");
my $index = $self->build_index($data->{modules});
my $file = $self->build_mirror_file($index);
@@ -181,7 +181,7 @@ sub build_mirror_file {
print $fh <<EOF;
File: 02packages.details.txt
URL: http://www.perl.com/CPAN/modules/02packages.details.txt
-Description: Package names found in carton.json
+Description: Package names found in carton.lock
Columns: package name, version, path
Intended-For: Automated fetch routines, namespace documentation.
Written-By: Carton $Carton::VERSION
@@ -228,8 +228,8 @@ sub cmd_show {
my $tree_mode;
$self->parse_options(\@args, "tree!" => \$tree_mode);
- my $data = $self->parse_json('carton.json')
- or $self->error("Can't find carton.json: Run `carton install` to rebuild the spec file.\n");
+ my $data = $self->parse_json('carton.lock')
+ or $self->error("Can't find carton.lock: Run `carton install` to rebuild the spec file.\n");
if ($tree_mode) {
my %seen;
@@ -324,7 +324,7 @@ sub cmd_check {
my $self = shift;
$self->check_cpanm_version;
- # check carton.json and extlib?
+ # check carton.lock and extlib?
}
sub check_cpanm_version {
@@ -371,7 +371,7 @@ sub update_packages {
};
require JSON;
- open my $fh, ">", "carton.json" or die $!;
+ open my $fh, ">", "carton.lock" or die $!;
print $fh JSON->new->pretty->encode($spec);
return 1;