Class: RSpec::Lono::Runner

Inherits:
Object
  • Object
show all
Extended by:
Memoist
Includes:
Concerns, Concerns
Defined in:
lib/rspec/lono/runner.rb,
lib/rspec/lono/runner/concerns.rb

Defined Under Namespace

Modules: Concerns

Constant Summary collapse

CLI =
Lono::CLI

Instance Method Summary collapse

Methods included from Concerns

#describe_stack_resources, #outputs, #resources, #stack

Methods included from Concerns

#detection

Methods included from Concerns::Logging

#logger

Constructor Details

#initialize(options = {}) ⇒ Runner

Returns a new instance of Runner.



11
12
13
14
15
16
17
# File 'lib/rspec/lono/runner.rb', line 11

def initialize(options={})
  @options = options
  @options[:blueprint] ||= detection.blueprint
  @blueprint = Lono::Blueprint.new(@options)
  @stack = Lono::Names.new(@options).stack
  @name = @blueprint.name
end

Instance Method Details

#build(args = '') ⇒ Object



19
20
21
# File 'lib/rspec/lono/runner.rb', line 19

def build(args='')
  run("build #{@name} #{args}")
end

#down(args = '') ⇒ Object



27
28
29
30
# File 'lib/rspec/lono/runner.rb', line 27

def down(args='')
  run("down #{@name} #{args} -y")
  self.flush_cache
end

#run(command) ⇒ Object



32
33
34
35
36
37
# File 'lib/rspec/lono/runner.rb', line 32

def run(command)
  command = command.strip
  puts "=> LONO_ENV=#{Lono.env} lono #{command}".color(:green)
  args = command.split(' ')
  CLI.start(args)
end

#up(args = '') ⇒ Object



23
24
25
# File 'lib/rspec/lono/runner.rb', line 23

def up(args='')
  run("up #{@name} #{args} -y")
end