=encoding utf8 =head1 NAME =begin original Carton - Perl module dependency manager (aka Bundler for Perl) =end original Carton - Perl module 依存マネージャー(aka Perl用 Bundler) =head1 SYNOPSIS # On your development environment > cat cpanfile requires 'Plack', '0.9980'; requires 'Starman', '0.2000'; > carton install > git add cpanfile cpanfile.snapshot > git commit -m "add Plack and Starman" # Other developer's machine, or on a deployment box > carton install > carton exec starman -p 8080 myapp.psgi =head1 AVAILABILITY (可用性) =begin original Carton only works with perl installation with the complete set of core modules. If you use perl installed by a vendor package with modules stripped from core, Carton is not expected to work correctly. =end original Carton は 完全なコアモジュールのセットと一緒にインストールされた perl でのみ 動きます。コアから分離された、ベンダーパッケージによってインストールされた Perlを使うなら、Carton は正確に動かないでしょう。 =begin original Also, Carton requires you to run your command/application with C command, which means it's difficult or impossible to run in an embedded perl use case such as mod_perl. =end original また、Cartonは、Cコマンドで、あなたのコマンド/アプリケーションを 動かすことを要求します。つまり、mod_perlのような組み込みのPerlのユースケースでは、 Cartonを使うのは、難しいか不可能という事です。 =head1 DESCRIPTION =begin original carton is a command line tool to track the Perl module dependencies for your Perl application. Dependencies are declared using L format, and the managed dependencies are tracked in a I file, which is meant to be version controlled, and the snapshot file allows other developers of your application will have the exact same versions of the modules. =end original carton は、アプリケーションのPerlモジュールの依存を追跡する コマンドラインツールです。依存は L フォーマットを使って 宣言されます。管理された依存は、Iファイルに 跡が残ります、これをバージョンコントロールします。 スナップショットファイルによって、あなたのアプリケーションの他の開発者は、 まったく同じバージョンのモジュールを持つことができるようになります。 =begin original For C syntax, see L documentation. =end original Cのシンタックスは、Lドキュメントを読んでください。 =head1 TUTORIAL (チュートリアル) =head2 Initializing the environment (環境を初期化する) =begin original carton will use the I directory to install modules into. You're recommended to exclude these directories from the version control system. =end original carton は、I ディレクトリをモジュールをインストールするディレクトリに使います。 バージョンコントロールシステムからそれらのディレクトリを除外することを推奨します。 > echo local/ >> .gitignore > git add cpanfile cpanfile.snapshot > git commit -m "Start using carton" =head2 Tracking the dependencies (依存の追跡) =begin original You can manage the dependencies of your application via C. =end original C でアプリケーションの依存を管理できます。 # cpanfile requires 'Plack', '0.9980'; requires 'Starman', '0.2000'; =begin original And then you can install these dependencies via: =end original 依存を以下のようにしてインストールできます: > carton install =begin original The modules are installed into your I directory, and the dependencies tree and version information are analyzed and saved into I in your directory. =end original モジュールは I ディレクトリにインストールされ、依存ツリーと バージョン情報は解析されて、ディレクトリ内の I に保存されます。 =begin original Make sure you add I and I to your version controlled repository 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. =end original I と I をバージョンコントロールリポジトリに 加えたことを確認して、依存を更新した際には、変更をコミットしてください。 あなたのアプリケーションの他の開発者が、あなたのデプロイメント環境と同様の、 あなたがインストールしたのと、ちょうど同じバージョンのモジュールを使う ことを保証します。 > git add cpanfile cpanfile.snapshot > git commit -m "Added Plack and Starman" =head2 Deploying your application (アプリケーションをデプロイする) =begin original Once you've done installing all the dependencies, you can push your application directory to a remote machine (excluding I and I<.carton>) and run the following command: =end original 全ての依存をインストールしたら、アプリケーションディレクトリを リモートのマシーンに(I と I<.carton> を除いて)、プッシュし、 以下のコマンドを実行します: > carton install --deployment =begin original This will look at the I and install the exact same versions of the dependencies into I, and now your application is ready to run. =end original このコマンドは、I を見て、ちょうど同じバージョンの依存を I にインストールします。これで、アプリケーションを実行する準備ができました。 =begin original The C<--deployment> flag makes sure that carton will only install modules and versions available in your snapshot, and won't fallback to query for CPAN Meta DB for missing modules. =end original C<--deployment> フラグは、carton がスナップショット内の利用可能なモジュールと バージョンのみをインストールしようとします。失われたモジュールのために、 CPAN Meta DB に問い合わせるフォールバックをしません。 =head2 Bundling modules (モジュールのビルド) =begin original 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. =end original carton は、依存のための 全てのtarボールをディレクトリにいれてバンドルできます。 そのため、CPANで、または、いわゆるDarkPANのような内部のディストリビューション上にあり、 利用可能でない依存をインストールすることさえ出来ます。 > carton bundle =begin original will bundle these tarballs into I directory, and =end original Iディレクトリに、それらの tarボール をバンドルして、 > carton install --cached =begin original will install modules using this local cache. Combined with C<--deployment> option, you can avoid querying for a database like CPAN Meta DB or downloading files from CPAN mirrors upon deployment time. =end original ローカルキャッシュを使って、モジュールをインストールします。 C<--deployment>オプションを組み合わせると、デプロイメント時に CPAN Meta DBのようなデータベースに問い合わせたり、 CPANミラーからファイルをダウンロードするのを避けることができます。 =head1 PERL VERSIONS (PERLのバージョン) =begin original When you take a snapshot in one perl version and deploy on another (different) version, you might have troubles with core modules. =end original 1つの perl のバージョンでスナップショットをとり、他の(違う)バージョンに デプロイする時、コアモジュールに関してトラブルが起きるかもしれません。 =begin original The simplest solution, which might not work for everybody, is to use the same version of perl in the development and deployment. =end original もっとも簡単な解決策は、全ての人に有効かわかりませんが、開発とデプロイに 同じ perl のバージョンを使うことです。 =begin original To enforce that, you're recommended to use L and C<.perl-version> to lock perl versions in development. =end original これを強制するには、L と C<.perl-version> を使って、 開発での perl のバージョンをロックすることを推奨します。 =begin original You can also specify the minimum perl required in C: =end original C で必要とされる最小の perl を指定することもできます: requires 'perl', '5.16.3'; =begin original and carton (and cpanm) will give you errors when deployed on hosts with perl lower than the specified version. =end original 指定されたバージョンより小さい perl でホストにデプロイすると、 carton (と cpanm) は、は、エラーを出します。 =head1 COMMUNITY (コミュニティ) =over 4 =item L =begin original Code repository, Wiki and Issue Tracker =end original コードリポジトリと Wiki とイシュートラッカー。 =item L =begin original IRC chat room =end original IRC チャットルーム =back =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 L L L L L L =cut