remocon 0.4.4 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -0
- data/lib/remocon/command/pull_command.rb +9 -9
- data/lib/remocon/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1c723a770c1ede6759e801b8e4e96ef13cd338f
|
4
|
+
data.tar.gz: c6becabe68044bab72fd31370b556143c6dee11c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19cfba1db8ce6a06417f2a93b922279056c170368ab07e76dec40b3a86b6ef2586241e67bb79960c70a3a2ab900ac306623c15c01294fe458eeba8d164c61c36
|
7
|
+
data.tar.gz: 6a81643a00d8d747a8d8c9c254a793560b34bb479843e40068f143f38e951ebe99f6c8acc6d0fed4d096b506cb98f09f201dd8a970e72566f2f0cb4a5a4d8f34
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,6 +9,9 @@ The goal of this gem is Remote Config as a Code. :)
|
|
9
9
|
|
10
10
|
If you'd like to use this on CircleCI, you can use https://github.com/jmatsu/remocon-starter-kit .
|
11
11
|
|
12
|
+
NOTE:
|
13
|
+
v0.4.4 and lower versions contain serious bugs. Please use 0.5.0 or greater, sorry.
|
14
|
+
|
12
15
|
## Usage
|
13
16
|
|
14
17
|
### Get your access token
|
@@ -55,14 +55,14 @@ module Remocon
|
|
55
55
|
unchanged_conditions, added_conditions, changed_conditions, = conditions_diff(left.conditions_to_be_compared, conditions)
|
56
56
|
unchanged_parameters, added_parameters, changed_parameters, = parameters_diff(left.parameters_to_be_compared, parameters)
|
57
57
|
|
58
|
-
|
59
|
-
|
58
|
+
conditions_array = JSON.parse(sort_conditions(unchanged_conditions + added_conditions + changed_conditions).to_json)
|
59
|
+
parameters_hash = JSON.parse(sort_parameters(unchanged_parameters.merge(added_parameters).merge(changed_parameters)).to_json)
|
60
60
|
else
|
61
|
-
|
62
|
-
|
61
|
+
conditions_array = JSON.parse(sort_conditions(Remocon::ConditionFileDumper.new(conditions).dump).to_json)
|
62
|
+
parameters_hash = JSON.parse(sort_parameters(Remocon::ParameterFileDumper.new(parameters).dump).to_json)
|
63
63
|
end
|
64
64
|
|
65
|
-
write_to_files(
|
65
|
+
write_to_files(conditions_array, parameters_hash, etag)
|
66
66
|
end
|
67
67
|
|
68
68
|
def conditions_diff(left, right)
|
@@ -132,19 +132,19 @@ module Remocon
|
|
132
132
|
|
133
133
|
private
|
134
134
|
|
135
|
-
def write_to_files(
|
135
|
+
def write_to_files(conditions_array, parameters_hash, etag)
|
136
136
|
File.open(config.conditions_file_path, "w+") do |f|
|
137
|
-
f.write(
|
137
|
+
f.write(conditions_array.to_yaml)
|
138
138
|
f.flush
|
139
139
|
end
|
140
140
|
|
141
141
|
File.open(config.parameters_file_path, "w+") do |f|
|
142
|
-
f.write(
|
142
|
+
f.write(parameters_hash.to_yaml)
|
143
143
|
f.flush
|
144
144
|
end
|
145
145
|
|
146
146
|
File.open(config.config_json_file_path, "w+") do |f|
|
147
|
-
f.write(JSON.pretty_generate({ conditions:
|
147
|
+
f.write(JSON.pretty_generate({ conditions: conditions_array, parameters: parameters_hash }))
|
148
148
|
f.flush
|
149
149
|
end
|
150
150
|
|
data/lib/remocon/version.rb
CHANGED