Module: Forger::Core
- Included in:
- Forger
- Defined in:
- lib/forger/core.rb
Constant Summary collapse
- @@config =
nil
- @@env =
nil
Instance Method Summary collapse
-
#cloudwatch_enabled?(options) ⇒ Boolean
cloudwatch cli option takes higher precedence than when its set in the config/settings.yml file.
- #config ⇒ Object
- #env ⇒ Object
- #root ⇒ Object
- #settings ⇒ Object
- #validate_in_project! ⇒ Object
Instance Method Details
#cloudwatch_enabled?(options) ⇒ Boolean
cloudwatch cli option takes higher precedence than when its set in the config/settings.yml file.
17 18 19 20 21 |
# File 'lib/forger/core.rb', line 17 def cloudwatch_enabled?() ![:cloudwatch].nil? ? [:cloudwatch] : # options can use symbols because this the options hash from Thor settings["cloudwatch"] # settings uses strings as keys end |
#config ⇒ Object
7 8 9 |
# File 'lib/forger/core.rb', line 7 def config @@config ||= Config.new.data end |
#env ⇒ Object
36 37 38 39 40 41 |
# File 'lib/forger/core.rb', line 36 def env return @@env if @@env env = env_from_profile(ENV['AWS_PROFILE']) || 'development' env = ENV['FORGER_ENV'] if ENV['FORGER_ENV'] # highest precedence @@env = env end |
#root ⇒ Object
23 24 25 26 |
# File 'lib/forger/core.rb', line 23 def root path = ENV['FORGER_ROOT'] || '.' Pathname.new(path) end |
#settings ⇒ Object
11 12 13 |
# File 'lib/forger/core.rb', line 11 def settings Setting.new.data end |
#validate_in_project! ⇒ Object
28 29 30 31 32 33 |
# File 'lib/forger/core.rb', line 28 def validate_in_project! unless File.exist?("#{root}/profiles") puts "Could not find a profiles folder in the current directory. It does not look like you are running this command within a forger project. Please confirm that you are in a forger project and try again.".colorize(:red) exit end end |