Sha256: e8a6097c42c36f5a83dbf00b49ce5cd7680c5ba8c7bcda1dbef0fca596e19ec2
Contents?: true
Size: 791 Bytes
Versions: 49
Compression:
Stored size: 791 Bytes
Contents
require 'flydata/helper/base_action' module Flydata module Helper module Action class UpdateHelperConfig < BaseAction def execute(opts = {}) conf_path = config[:config_path] || FLYDATA_HELPER_CONF helper_conf = opts[:config] helper_conf = "#{helper_conf}\n" if helper_conf && helper_conf.size > 0 && !helper_conf.end_with?("\n") if helper_conf log_info("updating Helper config:#{conf_path}") File.open(conf_path, "w") {|f| f.write helper_conf } else log_info("removing Helper config:#{conf_path}") File.unlink(conf_path) if File.exists?(conf_path) end # reload conf Process.kill("USR2", Process.ppid) end end end end end
Version data entries
49 entries across 49 versions & 1 rubygems