Class: Pigtail::Config
- Inherits:
-
Object
- Object
- Pigtail::Config
- Defined in:
- lib/pigtail/config.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
- #output ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
6 7 8 9 10 11 12 13 |
# File 'lib/pigtail/config.rb', line 6 def initialize( = {}) @options = @template = .delete(:template) @config_template = .delete(:config_template) || ":config" # @options[:environment_variable] ||= "RAILS_ENV" # @options[:environment] ||= :production # @options[:path] = Shellwords.shellescape(@options[:path] || Pigtail.path) end |
Instance Method Details
#output ⇒ Object
15 16 17 18 19 |
# File 'lib/pigtail/config.rb', line 15 def output config = process_template(@template, @options) out = process_template(@config_template, @options.merge(:config => config)) out.gsub(/%/, '\%') end |