Class: Pigtail::Config

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

Instance Method Summary collapse

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 = {})
  @options = options
  @template                         = options.delete(:template)
  @config_template                  = options.delete(:config_template) || ":config"
  # @options[:environment_variable] ||= "RAILS_ENV"
  # @options[:environment]          ||= :production
  # @options[:path]                   = Shellwords.shellescape(@options[:path] || Pigtail.path)
end

Instance Method Details

#outputObject



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