Sha256: 5698c11fc0b630adf4cbd6df1f605b143856b8f7a5fad97493809c900bc4626a
Contents?: true
Size: 1.17 KB
Versions: 50
Compression:
Stored size: 1.17 KB
Contents
class Vayacondios module Configliere def load_from_vayacondios(organization, id, options = {}) options.symbolize_keys!.deep_merge!(organization: organization) client = ::Vayacondios::HttpClient.receive(options.deep_compact!) id = [id, options[:env]].compact.join('.') begin new_data = client.fetch(:config, id) rescue ::Vayacondios::HttpClient::Error warn "Unable to load vayacondios config '#{id}' for #{organization} at: #{client.host}:#{client.port}" new_data = {} end deep_merge! new_data self end def save_to_vayacondios(organization, id, options = {}) options.symbolize_keys!.deep_merge!(organization: organization) client = ::Vayacondios::HttpClient.receive(options.deep_compact!) id = [id, options[:env]].compact.join('.') begin client.insert(self.to_hash, :config, id) rescue ::Vayacondios::HttpClient::Error warn "Unable to save vayacondios config '#{id}' for #{organization} at: #{client.host}:#{client.port}" end self end end end ::Configliere::Param.class_eval do include ::Vayacondios::Configliere end
Version data entries
50 entries across 50 versions & 2 rubygems