Module: R10K::CLI::Environment::List

Defined in:
lib/r10k/cli/environment/list.rb

Class Method Summary collapse

Class Method Details

.commandObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/r10k/cli/environment/list.rb', line 7

def self.command
  @cmd ||= Cri::Command.define do
    name  'list'
    usage 'list'
    summary 'List all available environments'

    run do |opts, args, cmd|
      deployment = R10K::Deployment.instance
      output = deployment.environments.inject('') do |str, root|
        str << "  - "
        str << "#{root.name}: #{root.full_path}"
        str << "\n"
      end

      puts output
    end
  end
end