Module: Lono::Core

Extended by:
Memoist
Included in:
Lono
Defined in:
lib/lono/core.rb,
lib/lono/core/config.rb

Defined Under Namespace

Classes: Config

Instance Method Summary collapse

Instance Method Details

#configObject



8
9
10
# File 'lib/lono/core.rb', line 8

def config
  Config.new
end

#envObject



19
20
21
22
23
# File 'lib/lono/core.rb', line 19

def env
  ufo_env = env_from_profile(ENV['AWS_PROFILE']) || 'development'
  ufo_env = ENV['LONO_ENV'] if ENV['LONO_ENV'] # highest precedence
  ufo_env
end

#rootObject



13
14
15
16
# File 'lib/lono/core.rb', line 13

def root
  path = ENV['LONO_ROOT'] || '.'
  Pathname.new(path)
end

#suffixObject

Precedence (highest to lowest)

1. LONO_SUFFIX
2. .current/lono
3. config/settings.yml


30
31
32
33
34
35
36
37
38
39
40
# File 'lib/lono/core.rb', line 30

def suffix
  suffix = ENV['LONO_SUFFIX'] # highest precedence
  suffix ||= Cfn::Current.suffix
  unless suffix
    settings = Setting.new.data
    suffix ||= settings["stack_name_suffix"] # lowest precedence
  end

  return if suffix&.empty?
  suffix
end