Class: BB8::Commands::InitialiseEnvironment

Inherits:
Object
  • Object
show all
Defined in:
lib/bb8/commands/initialise_environment.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, voltos_bundle) ⇒ InitialiseEnvironment

Returns a new instance of InitialiseEnvironment.



6
7
8
# File 'lib/bb8/commands/initialise_environment.rb', line 6

def initialize(name, voltos_bundle)
  @name, @voltos_bundle = name, voltos_bundle
end

Class Method Details

.call(name, voltos_bundle, *arguments) ⇒ Object



2
3
4
# File 'lib/bb8/commands/initialise_environment.rb', line 2

def self.call(name, voltos_bundle, *arguments)
  new(name, voltos_bundle).call
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
# File 'lib/bb8/commands/initialise_environment.rb', line 10

def call
  FileUtils.mkdir_p name
  Dir.chdir name
  File.write '.bb8_bundle', voltos_bundle

  append_token unless set_bundle?
  BB8::SetEncryptionKeys.call
end