Class: Spinup::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/spinup/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(playground, dir) ⇒ Runner

Returns a new instance of Runner.



3
4
5
6
7
8
9
10
11
12
# File 'lib/spinup/runner.rb', line 3

def initialize(playground, dir)
  default_dir = File.expand_path(Spinup::Config::DEFAULT_DIR)
  session_key = SecureRandom.hex[0..6]

  directory = dir || Locator.new(default_dir).(playground, session_key)
  config = Config::PLAYGROUNDS[playground]

  builder = PlaygroundBuilder.new(directory, Opener.new)
  builder.(playground, config)
end