Class: FigNewton::Commands::Clean

Inherits:
Object
  • Object
show all
Defined in:
lib/fig-newton/commands/clean.rb

Instance Method Summary collapse

Constructor Details

#initialize(stack_name, app, config_dir) ⇒ Clean

Returns a new instance of Clean.



6
7
8
9
10
# File 'lib/fig-newton/commands/clean.rb', line 6

def initialize(stack_name, app, config_dir)
  @stack_name = stack_name
  @app = app
  @config = FigNewton::Config.from_file(config_dir, @stack_name)
end

Instance Method Details

#run(parent_directory) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/fig-newton/commands/clean.rb', line 12

def run(parent_directory)
  if @app
    config.apps[@app].clean(parent_directory)
  else
    config.apps.each { |_, app| app.clean(parent_directory) }
  end
end