capタスクのソースコードを確認する方法

# 概要
本記事ではcapタスクのソースコードを確認する方法を記す。
初心者向けです。

## capタスクのコードを確認する
### タスクの一覧を表示する
　ターミナルなどで以下のコマンドを実行する。

```
cap -T
```
### タスクのコードを確認する
```
cap -W タスク名
=>cap タスク名 ファイルパスが表示される
```
### タスクをエディタで開く
sublime textの場合は以下のように開くその他のエディタの場合は対応したコマンドを使う。

```
subl ファイルパス
```

## capコマンドのオプション一覧
他にやりたいことがあったらググる前にまずはここを見る方が効率がいい。

```
$ cap -h
See full documentation at http://capistranorb.com/.

Install capistrano in a project:
    bundle exec cap install [STAGES=qa,staging,production,...]

Show available tasks:
    bundle exec cap -T

Invoke (or simulate invoking) a task:
    bundle exec cap [--dry-run] STAGE TASK

Advanced options:
        --backtrace=[OUT]            Enable full backtrace.  OUT can be stderr (default) or stdout.
        --comments                   Show commented tasks only
        --job-stats [LEVEL]          Display job statistics. LEVEL=history displays a complete job list
        --rules                      Trace the rules resolution.
        --suppress-backtrace PATTERN Suppress backtrace lines matching regexp PATTERN. Ignored if --trace is on.
    -A, --all                        Show all tasks, even uncommented ones (in combination with -T or -D)
    -B, --build-all                  Build all prerequisites, including those which are up-to-date.
    -D, --describe [PATTERN]         Describe the tasks (matching optional PATTERN), then exit.
    -e, --execute CODE               Execute some Ruby code and exit.
    -E, --execute-continue CODE      Execute some Ruby code, then continue with normal task processing.
    -f, --rakefile [FILENAME]        Use FILENAME as the rakefile to search for.
    -G, --no-system, --nosystem      Use standard project Rakefile search paths, ignore system wide rakefiles.
    -g, --system                     Using system wide (global) rakefiles (usually '~/.rake/*.rake').
    -I, --libdir LIBDIR              Include LIBDIR in the search path for required modules.
    -j, --jobs [NUMBER]              Specifies the maximum number of tasks to execute in parallel. (default is number of CPU cores + 4)
    -m, --multitask                  Treat all tasks as multitasks.
    -N, --no-search, --nosearch      Do not search parent directories for the Rakefile.
    -P, --prereqs                    Display the tasks and dependencies, then exit.
        --execute-print CODE         Execute some Ruby code, print the result, then exit.
        --require MODULE             Require MODULE before executing rakefile.
    -R, --rakelibdir RAKELIBDIR,     Auto-import any .rake files in RAKELIBDIR. (default is 'rakelib')
        --rakelib
    -t, --trace=[OUT]                Turn on invoke/execute tracing, enable full backtrace. OUT can be stderr (default) or stdout.
    -T, --tasks [PATTERN]            Display the tasks (matching optional PATTERN) with descriptions, then exit. -AT combination displays all of tasks contained no description.
    -W, --where [PATTERN]            Describe the tasks (matching optional PATTERN), then exit.
    -X, --no-deprecation-warnings    Disable the deprecation warnings.
    -V, --version                    Display the program version.
    -n, --dry-run                    Do a dry run without executing actions
    -r, --roles ROLES                Run SSH commands only on hosts matching these roles
    -z, --hosts HOSTS                Run SSH commands only on matching hosts
    -p, --print-config-variables     Display the defined config variables before starting the deployment tasks.
    -h, -H, --help                   Display this help message.
```