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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0f67e15a439278d3ad0b848f617a2cd9834bb29
4
- data.tar.gz: 64c36b6c0c47fc7308f0c0f6b547c5222782525e
3
+ metadata.gz: fd95da8157bbdd2b50a43afb0867c3c8909f7daf
4
+ data.tar.gz: 7d755e2c1e2a18daf57dd9005afe04599ea2290c
5
5
  SHA512:
6
- metadata.gz: b747c62af740fd105f72a569d82a96dc2a1d3ebb9dd4c5287b9f094eb5968f10a2f56599b3b93c461390b58ef4a1e87188571c0c76e47abe36ac0ad84915c93d
7
- data.tar.gz: 98da9024bd64b69ac977fedec04777a00059648d40ebc7e1b3edec4e85c73ac55dbc97afe5e31a237059283a0a31b5d46502303fcb27f027a6ff034ee2588702
6
+ metadata.gz: 0fe9e466fceef62b8f18aeecbb367b87bf1106f4cf91a4fbe59e4e96a67f0eb2dd0fd9e8868e6262a7b5b546a7fdfe2303bd47101fd81cf86c1ecaf266c77a78
7
+ data.tar.gz: 6fef9fb622338ee15e918542e4d72cc097d83871f995d7a55cf25293611e3e712337e2d75ac5b5c96ae8f8540d192994376fec1b4b167642432d26b84e5bb4ee
@@ -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[feature_name]
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
- result = JSON.parse(res.body);
170
- feature_configurations = {}
171
- result['features'].each{|feature|
172
- feature_configurations[feature['name']] = {
173
- name: feature['name'],
174
- state: feature['state']
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
- feature_configurations
185
+ feature_configurations
186
+ rescue
187
+ end
178
188
  end
179
189
  end
180
190
 
@@ -1,5 +1,5 @@
1
1
  module Makitoo
2
2
  module FeatureFlag
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
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.2
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-24 00:00:00.000000000 Z
11
+ date: 2017-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler