Class: Demae::CLI
- Inherits:
-
Thor
- Object
- Thor
- Demae::CLI
- Defined in:
- lib/demae/cli.rb
Constant Summary collapse
- CONFIG_DIR =
'config/demae'
Instance Method Summary collapse
- #apply(environment) ⇒ Object
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #install ⇒ Object
- #plan(environment) ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
9 10 11 12 13 |
# File 'lib/demae/cli.rb', line 9 def initialize(*) super Itamae.logger.level = ::Logger.const_get('INFO') Itamae.logger.formatter.colored = true end |
Instance Method Details
#apply(environment) ⇒ Object
25 26 27 |
# File 'lib/demae/cli.rb', line 25 def apply(environment) run(environment) end |
#install ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/demae/cli.rb', line 16 def install templates_dir = File.('../templates', __FILE__) FileUtils.mkdir_p(CONFIG_DIR) %w(staging production).each do |environment| FileUtils.copy("#{templates_dir}/environment.yml", config_path(environment)) end end |
#plan(environment) ⇒ Object
30 31 32 |
# File 'lib/demae/cli.rb', line 30 def plan(environment) run(environment, dry_run: true) end |