Class: Demeter::Commands::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/demeter/commands/base.rb

Direct Known Subclasses

Apply, Generate, Plan, Status

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Base

Returns a new instance of Base.



6
7
8
9
10
11
12
13
# File 'lib/demeter/commands/base.rb', line 6

def initialize(options)
  check_path
  ENV['DEMETER_ENV'] = options['environment']
  Dotenv.load(".env.#{options['environment']}")
  ::Aws.config.update(:logger => Logger.new(STDOUT))
  @ec2 = ::Aws::EC2::Client.new()
  @options = options
end

Instance Method Details

#check_pathObject



15
16
17
18
# File 'lib/demeter/commands/base.rb', line 15

def check_path
  fail "configs directory not found!" if !File.directory?('./configs')        
  fail "variables directory not found!" if !File.directory?('./variables')        
end