Class: PlacerDSL

Inherits:
Object
  • Object
show all
Defined in:
lib/placer_dsl.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, logger) ⇒ PlacerDSL

Returns a new instance of PlacerDSL.



45
46
47
48
49
# File 'lib/placer_dsl.rb', line 45

def initialize(config, logger)
  @logger = logger

  instance_eval config
end

Instance Method Details

#sftp(&block) ⇒ Object



57
58
59
60
61
# File 'lib/placer_dsl.rb', line 57

def sftp(&block)
  Net::SFTP.start(@ssh_host, @ssh_user, @ssh_options) do |c|
    block.call SFTPDSL.new(c, @logger)
  end
end

#ssh(&block) ⇒ Object



51
52
53
54
55
# File 'lib/placer_dsl.rb', line 51

def ssh(&block)
  Net::SSH.start(@ssh_host, @ssh_user, @ssh_options) do |c|
    block.call SSHDSL.new(c, @logger)
  end
end