Class: Composer::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/composer/cli.rb

Instance Method Summary collapse

Constructor Details

#initializeCli

Returns a new instance of Cli.



6
7
8
9
10
11
12
# File 'lib/composer/cli.rb', line 6

def initialize
  @opts   = parse_options
  @config = Config.new :log_level => @opts[:log_level]
  @logger = @config.logger

  validate_options
end

Instance Method Details

#startObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/composer/cli.rb', line 14

def start
  configure_aws

  compose = Compose.new :config    => @config,
                        :name      => @opts[:name],
                        :key       => @opts[:key],
                        :directory => @opts[:directory] ||= '.',
                        :secret    => @opts[:secret]
  begin
    compose.check
    compose.run
  rescue Composer::ComposerException => e
    @logger.error e.message
    exit 1
  end
end