makitoo-feature_flag 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/lib/makitoo/feature_flag.rb +19 -9
- data/lib/makitoo/feature_flag/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd95da8157bbdd2b50a43afb0867c3c8909f7daf
|
4
|
+
data.tar.gz: 7d755e2c1e2a18daf57dd9005afe04599ea2290c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fe9e466fceef62b8f18aeecbb367b87bf1106f4cf91a4fbe59e4e96a67f0eb2dd0fd9e8868e6262a7b5b546a7fdfe2303bd47101fd81cf86c1ecaf266c77a78
|
7
|
+
data.tar.gz: 6fef9fb622338ee15e918542e4d72cc097d83871f995d7a55cf25293611e3e712337e2d75ac5b5c96ae8f8540d192994376fec1b4b167642432d26b84e5bb4ee
|
data/lib/makitoo/feature_flag.rb
CHANGED
@@ -40,6 +40,8 @@ module Makitoo
|
|
40
40
|
@application_id = application_id
|
41
41
|
@server = if options.has_key?(:server)
|
42
42
|
options[:server]
|
43
|
+
elsif options[:ssl]
|
44
|
+
'https://features.makitoo.com/api/v1'
|
43
45
|
else
|
44
46
|
'http://features.makitoo.com/api/v1'
|
45
47
|
end
|
@@ -104,7 +106,11 @@ module Makitoo
|
|
104
106
|
if feature_configurations.nil?
|
105
107
|
feature_configurations = refresh_feature_configurations_cache(installation_id)
|
106
108
|
end
|
107
|
-
feature_configurations
|
109
|
+
if feature_configurations.nil?
|
110
|
+
nil
|
111
|
+
else
|
112
|
+
feature_configurations[feature_name]
|
113
|
+
end
|
108
114
|
end
|
109
115
|
|
110
116
|
def create_seen_event(feature_name, installation_id)
|
@@ -151,6 +157,7 @@ module Makitoo
|
|
151
157
|
end
|
152
158
|
|
153
159
|
def post_json(url_str, data)
|
160
|
+
puts url_str
|
154
161
|
url = URI.parse(url_str)
|
155
162
|
req = Net::HTTP::Post.new(url.to_s, 'Content-Type' => 'application/json')
|
156
163
|
req.body = data.to_json
|
@@ -166,15 +173,18 @@ module Makitoo
|
|
166
173
|
environmentName: @environment_name
|
167
174
|
}), event)
|
168
175
|
if !res.body.nil?
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
176
|
+
begin
|
177
|
+
result = JSON.parse(res.body);
|
178
|
+
feature_configurations = {}
|
179
|
+
result['features'].each{|feature|
|
180
|
+
feature_configurations[feature['name']] = {
|
181
|
+
name: feature['name'],
|
182
|
+
state: feature['state']
|
183
|
+
}
|
175
184
|
}
|
176
|
-
|
177
|
-
|
185
|
+
feature_configurations
|
186
|
+
rescue
|
187
|
+
end
|
178
188
|
end
|
179
189
|
end
|
180
190
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: makitoo-feature_flag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makitoo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|