ft_gem 3.1.5 → 3.1.6

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
  SHA256:
3
- metadata.gz: f59d9f1f380088f670d59c8d4d1717a201c3fe01469b06869e0782c1ae10caf7
4
- data.tar.gz: c9f1ecb7b7e2138a8452d939d7560de5dcc5d1fa21a297ffab725d52b05fd4a3
3
+ metadata.gz: 5ca0566dc7734cac585efc11741f71fdd293e4a924d207d0285d0555d4c63f34
4
+ data.tar.gz: d88568950bac57aa06858fa31dc5b18f32179d938cf79c2f08045894984a3230
5
5
  SHA512:
6
- metadata.gz: 06e2149714a5b1d095275f98ff5e448c6f436b441a608e43b12ef7d82e0f9fbf687c3a4d7f9c504187d0ca0cddb1e89d78f8a475dd2533ea5c044d798210f3b7
7
- data.tar.gz: 54f5a746a6c7fb7ec73b89d37827a33d4aeefd6253c0bec17f0dcbf8e95d0e98d01b2712c7c3135b64a4433eed6b391d76415838b30ffdca0cddb9d41a38bc14
6
+ metadata.gz: 530936aef0568a373e8b59aba62ff94bbb11593ea3b6c96ac7a860fa4351f0d578a4fe439df584ccf8c61bbce872aa42df0233eb3e7cb377542ceb6bcea9171b
7
+ data.tar.gz: 21a2c60a25d65c333fda8ed4cfe7eb6ea616cfd8490e9ff5acd46893f31adb0b6efc4f26b49e3afa79c4f01fdfe57d3737b31965c327b8c57457c070d4c1135c
@@ -14,8 +14,8 @@ module FtGem
14
14
  client_percentage = calc_client_percentage(decoded_cookie: decoded_cookie, toggle_name: name)
15
15
  toggle_percentage = toggles[index.to_i]['attributes']['percentage']
16
16
  whitelisted = FtShared.new.whitelisted?(url: url, whitelist_urls: toggles[index.to_i]['attributes']['whitelist-urls'])
17
- if user_id.present? && toggles[index.to_i]['attributes']['status'] == "amber" && toggles[index.to_i]['attributes']['beta-users'] != "" && toggles[index.to_i]['attributes']['beta-users'].split(",").include?(user_id.to_s)
18
- return true
17
+ if user_id_beta(user_id: user_id)
18
+ return true && whitelisted
19
19
  else
20
20
  return client_percentage.to_i <= toggle_percentage.to_i && whitelisted
21
21
  end
@@ -53,6 +53,12 @@ module FtGem
53
53
  def api_feature_toggle_status(name:)
54
54
  FtGem::View::Helpers.status(name: name)
55
55
  end
56
+
57
+ private
58
+
59
+ def user_id_beta(user_id: nil)
60
+ user_id.present? && toggles[index.to_i]['attributes']['status'] == "amber" && toggles[index.to_i]['attributes']['beta-users'].split(",").include?(user_id.to_s)
61
+ end
56
62
  end
57
63
  end
58
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ft_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.5
4
+ version: 3.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Murray Catto