Class: EbDeployer::DefaultConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_name) ⇒ DefaultConfig

Returns a new instance of DefaultConfig.



5
6
7
# File 'lib/eb_deployer/default_config.rb', line 5

def initialize(app_name)
  @app_name = app_name.gsub('_', '-')
end

Instance Attribute Details

#app_nameObject (readonly)

Returns the value of attribute app_name.



3
4
5
# File 'lib/eb_deployer/default_config.rb', line 3

def app_name
  @app_name
end

Instance Method Details

#write_to(path) ⇒ Object



9
10
11
12
# File 'lib/eb_deployer/default_config.rb', line 9

def write_to(path)
  FileUtils.mkdir_p(File.dirname(path))
  File.open(path, 'w') { |f| f << ERB.new(File.read(config_template)).result(binding) }
end