optimizely-sdk 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 948c6214e7f77820c80ba9f419260555c17419ba
4
- data.tar.gz: 0dfe6752f4194aa537c9364587f292a39125f4f5
3
+ metadata.gz: 01adaffe5e054d857678ed1b489ed18ed2edd4f8
4
+ data.tar.gz: 54adf65efba02815c56f590bb55928c2a00c3900
5
5
  SHA512:
6
- metadata.gz: d81fc2852d21a471d14c5a20c80c967baba140ee0387326cb427474b71e215056e51aa4c0d75dba23ceb1024b576c9eef988ff653ab40ea4afd3a74a1cefba1b
7
- data.tar.gz: 9010d5770d5b5e446b0494ca7de9f21f91d1e2949acf91958a1afa48492b8fe18aa3255a7b68315918ca3a175f57743f9b2b1eb815ad7d33a0efda42b47acda7
6
+ metadata.gz: f3b16cb239fb9d5c391ca4359a964454cb71a9e7871a5645a86fd675000547f0fededbd7448826afd5a86000db272f59a7439bf09897e335fbfa50c52b745dcd
7
+ data.tar.gz: 8e64266fb986573b13ca9cabec300632f0c7890aaec9bf74849acca984470ae98ba09d1cdb550b01c1f4f724c3a29a9efe830d3b7f6813b09776ae5c62e610d6
data/lib/optimizely.rb CHANGED
@@ -258,7 +258,6 @@ module Optimizely
258
258
  # Returns True if the feature is enabled.
259
259
  # False if the feature is disabled.
260
260
  # False if the feature is not found.
261
-
262
261
  unless @is_valid
263
262
  logger = SimpleLogger.new
264
263
  logger.log(Logger::ERROR, InvalidDatafileError.new('is_feature_enabled').message)
@@ -286,12 +285,6 @@ module Optimizely
286
285
  end
287
286
 
288
287
  variation = decision['variation']
289
- unless variation['featureEnabled']
290
- @logger.log(Logger::INFO,
291
- "Feature '#{feature_flag_key}' is not enabled for user '#{user_id}'.")
292
- return false
293
- end
294
-
295
288
  if decision.source == Optimizely::DecisionService::DECISION_SOURCE_EXPERIMENT
296
289
  # Send event if Decision came from an experiment.
297
290
  send_impression(decision.experiment, variation['key'], user_id, attributes)
@@ -299,9 +292,16 @@ module Optimizely
299
292
  @logger.log(Logger::DEBUG,
300
293
  "The user '#{user_id}' is not being experimented on in feature '#{feature_flag_key}'.")
301
294
  end
302
- @logger.log(Logger::INFO, "Feature '#{feature_flag_key}' is enabled for user '#{user_id}'.")
303
295
 
304
- true
296
+ if variation['featureEnabled'] == true
297
+ @logger.log(Logger::INFO,
298
+ "Feature '#{feature_flag_key}' is enabled for user '#{user_id}'.")
299
+ return true
300
+ else
301
+ @logger.log(Logger::INFO,
302
+ "Feature '#{feature_flag_key}' is not enabled for user '#{user_id}'.")
303
+ return false
304
+ end
305
305
  end
306
306
 
307
307
  def get_enabled_features(user_id, attributes = nil)
@@ -17,5 +17,5 @@
17
17
  #
18
18
  module Optimizely
19
19
  CLIENT_ENGINE = 'ruby-sdk'
20
- VERSION = '2.0.1'
20
+ VERSION = '2.0.2'
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optimizely-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Optimizely
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-25 00:00:00.000000000 Z
11
+ date: 2018-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler