vayacondios-client 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/vayacondios/client/configliere.rb +38 -0
- data/lib/vayacondios-client.rb +1 -3
- metadata +4 -3
@@ -0,0 +1,38 @@
|
|
1
|
+
class Vayacondios
|
2
|
+
module Configliere
|
3
|
+
|
4
|
+
def load_from_vayacondios(organization, id, options = {})
|
5
|
+
options.symbolize_keys!.deep_merge!(organization: organization)
|
6
|
+
|
7
|
+
client = ::Vayacondios::HttpClient.receive(options.deep_compact!)
|
8
|
+
id = [id, options[:env]].compact.join('.')
|
9
|
+
|
10
|
+
begin
|
11
|
+
new_data = client.fetch(:config, id)
|
12
|
+
rescue ::Vayacondios::HttpClient::Error
|
13
|
+
warn "Unable to load vayacondios config '#{id}' for #{organization} at: #{client.host}:#{client.port}"
|
14
|
+
new_data = {}
|
15
|
+
end
|
16
|
+
deep_merge! new_data
|
17
|
+
self
|
18
|
+
end
|
19
|
+
|
20
|
+
def save_to_vayacondios(organization, id, options = {})
|
21
|
+
options.symbolize_keys!.deep_merge!(organization: organization)
|
22
|
+
|
23
|
+
client = ::Vayacondios::HttpClient.receive(options.deep_compact!)
|
24
|
+
id = [id, options[:env]].compact.join('.')
|
25
|
+
|
26
|
+
begin
|
27
|
+
client.insert(self.to_hash, :config, id)
|
28
|
+
rescue ::Vayacondios::HttpClient::Error
|
29
|
+
warn "Unable to save vayacondios config '#{id}' for #{organization} at: #{client.host}:#{client.port}"
|
30
|
+
end
|
31
|
+
self
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
::Configliere::Param.class_eval do
|
37
|
+
include ::Vayacondios::Configliere
|
38
|
+
end
|
data/lib/vayacondios-client.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vayacondios-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -118,6 +118,7 @@ extensions: []
|
|
118
118
|
extra_rdoc_files: []
|
119
119
|
files:
|
120
120
|
- lib/vayacondios-client.rb
|
121
|
+
- lib/vayacondios/client/configliere.rb
|
121
122
|
- lib/vayacondios/client/http_client.rb
|
122
123
|
- lib/vayacondios/client/notifier.rb
|
123
124
|
- spec/client/notifier_spec.rb
|
@@ -135,7 +136,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
136
|
version: '0'
|
136
137
|
segments:
|
137
138
|
- 0
|
138
|
-
hash: -
|
139
|
+
hash: -1930974807112086192
|
139
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
141
|
none: false
|
141
142
|
requirements:
|
@@ -144,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
145
|
version: '0'
|
145
146
|
segments:
|
146
147
|
- 0
|
147
|
-
hash: -
|
148
|
+
hash: -1930974807112086192
|
148
149
|
requirements: []
|
149
150
|
rubyforge_project:
|
150
151
|
rubygems_version: 1.8.23
|