Skip to content

Commit 71dccef

Browse files
committed
Done!
1 parent aa81445 commit 71dccef

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

IV-Usage/Services.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
When creating tasks, strategies, binaries, etc., Rocketeer provides you with a variety of services you can access and use to ease your work. While all of them are describe in the public API, some are more important than others. This is a look at what Rocketeer provides you with, and gives you a little more insight on how things work under the hood.
1111
-->
1212

13-
[translation here]
13+
提供される全ての例は、カスタムタスクを想定しています。ただ、これはクロージャタスクでも同じように適用されます。つまり、もしタスククラスの中で`$this->foo->bar()`のようにできるとしたら、クロージャの中であれば次のようになります。
1414

1515
<!--original
1616
All examples provided are from the viewpoint of a custom task. But it also applies to closure tasks, meaning if within a task class you can do `$this->foo->bar()`, within a closure you can do this:
@@ -22,19 +22,19 @@ Rocketeer::before('deploy', function (AbstractTask $task) {
2222
});
2323
```
2424

25-
[translation here]
25+
それぞれのサービスの隣の括弧内の文字列は、それを通じてアクセス可能なハンドルです。
2626

2727
<!--original
2828
The string between brackets next to each service is the handle it can be access through.
2929
-->
3030

31-
[translation here]
31+
## タスクビルダー [builder]
3232

3333
<!--original
3434
## Tasks Builder [builder]
3535
-->
3636

37-
[translation here]
37+
タスクビルダーはRocketeerの最も重要なサービスのひとつです。タスクから、簡単にバイナリー、タスク、ストラテジなどのインスタンスを得るための強力な手段です。許されているどんなタスクでもビルドすることができます: ワンライナー、クロージャ、インスタンス、クラス名など。
3838

3939
<!--original
4040
The tasks builder is one of Rocketeer's most important services, its a powerful factory that allows you to quickly get instances of binaries, tasks, strategies and so on, from within your tasks. It can build tasks from anything that is allowed: one-liners, closures, instances, or class names.
@@ -66,13 +66,13 @@ $this->builder->buildStrategy('Deploy', 'Clone');
6666
$this->builder->buildCommand('Deploy'); // DeployCommand
6767
```
6868

69-
[translation here]
69+
## タスクキュー [queue]
7070

7171
<!--original
7272
## Tasks Queue [queue]
7373
-->
7474

75-
[translation here]
75+
タスクキューは、Rocketeerのもう一つの主だったクラスです。タスクの配列を受け取って、それから実行可能なパイプラインを構築します。同じ種類のタスクタイプ(クロージャ、文字列、クラス名など)を渡せるよう、全てはTasksBuilderを通して渡されます。
7676

7777
<!--original
7878
The tasks queue is the other major class of Rocketeer, it receives an array of tasks, and builds a runnable pipeline from it. Anything it receives is passed through the TasksBuilder so you can pass the same kind of tasks types (closures, strings, class names, etc.) as above.
@@ -90,13 +90,13 @@ $files = $this->queue->execute(['cd /foo/bar', 'ls'], 'production');
9090
$files = $this->queue->on('production', ['cd /foo/bar', 'ls']);
9191
```
9292

93-
[translation here]
93+
`run`メソッドは`Rocketeer\Services\Tasks\Pipeline`のインスタンスを返します。`Pipeline``Illuminate\Support\Collection`を拡張したクラスで、`Rocketeer\Services\Tasks\Job`のインスタンスを保持します。
9494

9595
<!--original
9696
The `run` method will return an instance of `Rocketeer\Services\Tasks\Pipeline`. The Pipeline is a class extending `Illuminate\Support\Collection` that stores instances of `Rocketeer\Services\Tasks\Job`.
9797
-->
9898

99-
[translation here]
99+
Rocketeerでは、ジョブとは実行に必要な情報を持つひとまとまりのキューです: キューがどんな接続を必要とするのか、どのステージか、どのサーバか、etc. あなたが、二つの接続、`production``staging`を持っていると想像してください。次のようなパイプラインを得るでしょう:
100100

101101
<!--original
102102
Within Rocketeer, a Job is a bundled version of a queue, containing all the necessary information required to run it: what connection the queue needs to be run on, what stage, what server, etc. Imagine you have two connections, `production` and `staging`, you'll get the following pipeline:
@@ -114,19 +114,19 @@ $firstJob->connection; // staging
114114
$firstJob->queue; // [ClosureTask(cd /foo/Bar), ClosureTask(ls)]
115115
```
116116

117-
[translation here]
117+
一度パイプラインが構築されると、`--pretend`フラグが渡されるか次第で、同期的か非同期的に実行されます。
118118

119119
<!--original
120120
Once the pipeline is built it is either run synchronously or asynchronously depending on whether the `--pretend` flag was passed.
121121
-->
122122

123-
[translation here]
123+
## タスクハンドラ [tasks]
124124

125125
<!--original
126126
## Tasks Handler [tasks]
127127
-->
128128

129-
[translation here]
129+
タスクハンドラは関連するタスクやプラグイン、イベントを登録します。それが`Rocketeer`のファサードの後ろの主なタスクなので、そのメソッド(before, after, listenTo, task)のほとんどに精通している必要があります:
130130

131131
<!--original
132132
The tasks handler registers the tasks, plugins, and events that surrounds them. It's the main task behind the `Rocketeer` facade so you should be familiar with most of its methods (before, after, listenTo, task):
@@ -142,13 +142,13 @@ $this->tasks->before('Deploy', 'list-files');
142142
$events = $this->tasks->getTasksListeners('deploy', 'before');
143143
```
144144

145-
[translation here]
145+
## ステップビルダー [steps()]
146146

147147
<!--original
148148
## Steps Builder [steps()]
149149
-->
150150

151-
[translation here]
151+
ステップビルダーはタスクに一連の内部的なコマンドや呼び出しを実行させ、最初の失敗で停止できるようにするものです。インターフェースの使いやすさはそのままに。次のような、架空のタスクの中の一連のコマンドを見てみましょう:
152152

153153
<!--original
154154
The steps builder is what allows tasks to run a series of internal commands and calls and halts on the first failure, while keeping a fluent interface. Take the following series of commands inside an imaginary task:
@@ -159,7 +159,7 @@ $this->executeTask('Migrate');
159159
$this->symlink('foo', 'bar');
160160
```
161161

162-
[translation here]
162+
ここで、Migrateタスクが失敗した場合は、symlinkを実行したくないとしたら、`steps()`を単純に前につけます:
163163

164164
<!--original
165165
Now ideally we would want to not execute the symlink if the Migrate task fails, for this, we simply prepend those calls with `steps()`:
@@ -170,7 +170,7 @@ $this->steps()->executeTask('Migrate');
170170
$this->steps()->symlink('foo', 'bar');
171171
```
172172

173-
[translation here]
173+
これで、これらの「ステップ」はタスクの`steps`プロパティに保持されます。一度完了すれば、安全に順番を追ってそれらを実行することができます。ステップが失敗しない限りは。
174174

175175
<!--original
176176
This will store those "steps" within a `steps` property on the tasks. Once this is done we can safely run them sequentially until one fails:
@@ -186,19 +186,19 @@ if (!$this->runSteps()) {
186186
}
187187
```
188188

189-
[translation here]
189+
## キューの説明 [explainer]
190190

191191
<!--original
192192
## Queue Explainer [explainer]
193193
-->
194194

195-
[translation here]
195+
キューの「説明(explainer)」は、RocketeerのCLI出力をコントロールするものです。ユーザに何が起きているかを説明し、どのタスクがどのタスクやイベントによって引き起こされ、何が進行しているか、その結果、そして実行にどのくらいの時間がかかるのか、など。
196196

197197
<!--original
198198
The queue explainer is what drives Rocketeer's CLI output, its job is to explain to the user what is happening, what tasks are fired by what task or event, what is their progress, their result, how long they took to execute, etc.
199199
-->
200200

201-
[translation here]
201+
デフォルトでは、タスクの実行時、「説明」はあなたがセットした`name``description`プロパティから、自動的に情報を表示します。ですが、タスクのフローの中で「説明」に追加の詳細を提供することも可能です:
202202

203203
<!--original
204204
By default when executing a task, the explainer will automatically display information about it from the `name` and `description` property you set on it (or passed to `Rocketeer::task`). But you can provide additional details to the explainer during the flow of your task:
@@ -213,7 +213,7 @@ if (!$this->somethingThatMayFail()) {
213213
$this->explainer->success('All went well!');
214214
```
215215

216-
[translation here]
216+
「説明」はCommandインスタンスの`line`メソッドに、それを渡しています。つまり、[Symfonyドキュメント](http://symfony.com/doc/current/components/console/introduction.html#coloring-the-output)に記述された前景色と背景色を追加することも可能です。
217217

218218
<!--original
219219
The explainer passes that to the Command instance's `line` method, meaning you can add foreground and background colors as described in [Symfony's documentation](http://symfony.com/doc/current/components/console/introduction.html#coloring-the-output):
@@ -223,7 +223,7 @@ The explainer passes that to the Command instance's `line` method, meaning you c
223223
$this->explainer->line('<info>Something</info> tried and <bg=red>failed</bg=red>');
224224
```
225225

226-
[translation here]
226+
たぶんお気付きのように、「説明」はあなたのタスクの「ツリー」を実行時に構築します。もしタスクやイベントの内部で呼び出されるなら、タスクはネストされます:
227227

228228
<!--original
229229
As you may have noticed, the explainer builds a "tree" of your tasks at runtime, nesting tasks if they are fired within a task, or an event:
@@ -236,7 +236,7 @@ As you may have noticed, the explainer builds a "tree" of your tasks at runtime,
236236
|------ Running strategy for Deploy: Sync
237237
```
238238

239-
[translation here]
239+
これは、コマンドをクロージャの中にラッピングすることで可能です。
240240

241241
<!--original
242242
You can do this to by wrapping some commands in a closure:

0 commit comments

Comments
 (0)