Class: FigNewton::Commands::Pull

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

Instance Method Summary collapse

Constructor Details

#initialize(stack_name, app, config_dir) ⇒ Pull

Returns a new instance of Pull.



6
7
8
9
10
# File 'lib/fig-newton/commands/pull.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/pull.rb', line 12

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