Class: Rascal::CLI::Update

Inherits:
Base
  • Object
show all
Defined in:
lib/rascal/cli/update.rb

Instance Method Summary collapse

Constructor Details

#initialize(thor, options, environment_name) ⇒ Update

Returns a new instance of Update.



6
7
8
9
10
11
12
13
14
# File 'lib/rascal/cli/update.rb', line 6

def initialize(thor, options, environment_name)
  @environment_name = if options[:all]
    fail_with_error('Cannot give --all and an environment name!') if environment_name
    :all
  else
    environment_name
  end
  super(thor, options)
end

Instance Method Details

#runObject



16
17
18
19
20
21
# File 'lib/rascal/cli/update.rb', line 16

def run
  images = []
  each_environment(@environment_name) do |environment|
    images += environment.update(skip: images)
  end
end