Class: Redirus::Worker::AddProxy

Inherits:
Proxy
  • Object
show all
Defined in:
lib/redirus/worker/add_proxy.rb

Instance Method Summary collapse

Methods inherited from Proxy

#perform

Instance Method Details

#perform_action(name, workers, type, props = nil) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/redirus/worker/add_proxy.rb', line 5

def perform_action(name, workers, type, props = nil)
  params = config_propertie(name, workers, type, props)
  File.open(config_file_path(name, type), 'w') do |file|
    param_regexp = '#{\w*}'
    file.write config.config_template
      .gsub(/#{param_regexp}/) { |p| params[p[2..-2]] }
  end
end