Class: EbDeployer::DefaultConfig
- Inherits:
-
Object
- Object
- EbDeployer::DefaultConfig
- Defined in:
- lib/eb_deployer/default_config.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
Instance Method Summary collapse
-
#initialize(app_name) ⇒ DefaultConfig
constructor
A new instance of DefaultConfig.
- #write_to(path) ⇒ Object
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_name ⇒ Object (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 |