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

Version Path
flydata-0.8.10.2 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.10.1 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.9.11 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.10 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.9 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.8 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.7 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.6 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.5 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.4 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.3 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.2 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.1 lib/flydata/helper/action/update_helper_config.rb
flydata-0.8.0 lib/flydata/helper/action/update_helper_config.rb
flydata-0.7.19 lib/flydata/helper/action/update_helper_config.rb
flydata-0.7.18 lib/flydata/helper/action/update_helper_config.rb
flydata-0.7.17 lib/flydata/helper/action/update_helper_config.rb
flydata-0.7.16 lib/flydata/helper/action/update_helper_config.rb
flydata-0.7.15 lib/flydata/helper/action/update_helper_config.rb
flydata-0.7.14 lib/flydata/helper/action/update_helper_config.rb