ft_gem 3.1.0 → 3.1.1

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: 882b46bd6292e36ab8cd057adcd6982091a0bb50549c038955466bcd547ea134
4
- data.tar.gz: 00516c790a74ec6d5b03036ac9784371f25da4e70bd532d6c8b522cf91199e31
3
+ metadata.gz: 8cc187fec2bd3bd0d3ccf9d8155474ab1df2b4d159f7182721358e489d1a1b26
4
+ data.tar.gz: 949d225f2cf30a87bdde4cff8d84f325f5772c19ef0cee44902a8c562992740c
5
5
  SHA512:
6
- metadata.gz: b680e623e2eb1268c119bd0a059c2a0a5f25a7763ac58e7682fba4dbe8c3a7ec46d02b291dbf002145e140c2907b3ba326aac0c44dd253f72e9481a1523714b0
7
- data.tar.gz: 5aadadf5af0047d30584a4a70e4e819539f934fb2d09fbad5b012c5181daa3e614944df5990d9de5438bfe7b31834e5b1c99a6bbef0062188948b91fb76fde48
6
+ metadata.gz: 767bafbc0e9aad4a588cb6fac23bab2cfd32ba59d1bb1f864fdaccc0293121511ec1ff74a9957f68bb2ad562c47745ef871aa499b7c0ab411ca0d0d222b0b538
7
+ data.tar.gz: e2dfc3d9c9cc86fa9dce15d232c1b9409eb05c971d9ec59fa8f8ab708546a490ef5d9aec8f1699e4137bf61489881755faef99b004478619c2126367a5c62c69
@@ -1,10 +1,12 @@
1
1
  class FtShared
2
2
  def fetch(name:)
3
+ http_response = ''
3
4
  Rails.cache.fetch("feature-toggle-#{name}", expires_in: 1.minute) do
4
- JSON.parse(HTTParty.get("#{ENV['SITE_URL']}/service/ft/api/v1/feature-toggles/status", query: { name: name }, headers: authentication_header).to_json)['data']
5
+ http_response = HTTParty.get("#{ENV['SITE_URL']}/service/ft/api/v1/feature-toggles/status", query: { name: name }, headers: authentication_header)
6
+ JSON.parse(http_response.to_json)['data']
5
7
  end
6
8
  rescue StandardError => e
7
- Rails.logger.error "FtHelper::fetch error #{e.backtrace}"
9
+ Rails.logger.error "FtHelper::fetch error for #{name}\nerror: #{e.message}\nhttp_response: #{http_response}"
8
10
  nil
9
11
  end
10
12
 
@@ -13,7 +15,7 @@ class FtShared
13
15
  JSON.parse(HTTParty.get("#{ENV['SITE_URL']}/service/ft/api/v1/feature-toggles/", headers: authentication_header).to_json)['data']
14
16
  end
15
17
  rescue StandardError => e
16
- Rails.logger.error "FtHelper::all_toggles error #{e.backtrace}"
18
+ Rails.logger.error "FtHelper::all_toggles error #{e.message}"
17
19
  {}
18
20
  end
19
21
 
@@ -7,7 +7,7 @@ module FtGem
7
7
  whitelisted = FtShared.new.whitelisted?(url: url, whitelist_urls: toggle['attributes']['whitelist-urls'])
8
8
  toggle['attributes']['percentage'].to_i == 100 && whitelisted
9
9
  rescue StandardError => e
10
- Rails.logger.error "FtHelper::status error #{e.backtrace}"
10
+ Rails.logger.error "FtHelper::status error #{e.message}"
11
11
  false
12
12
  end
13
13
  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.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Murray Catto