prefab-cloud-ruby 0.0.20 → 0.0.21

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: 1b859100b5f964bd49e82089cca141a425f85d38
4
- data.tar.gz: 257e08f0c4999df0412116fadd89d7522b3c4773
3
+ metadata.gz: 796a81196d4bce247cd01bfdd98df3b5cdb19cb2
4
+ data.tar.gz: 117e1a5d7e8d34e2f0ad8dc0059de1dac1c4f908
5
5
  SHA512:
6
- metadata.gz: 53fee2f2d78247d657c829616b32c4807f94049147e1ad0f537ff887626e88724329931c4301e4471271d1376517045e8f858c79b594e0d990893a8dc5017d63
7
- data.tar.gz: 614ef6c55d2d0e669b42cd564b5c01fca42a195c47335cd3ace3a738d1daf24b07f584394f53c792432a681ea44cec2cd37b7df7041bc489d6c6f7644beb73fd
6
+ metadata.gz: 1026409f79503472a10d0abb6adb97577b2f7ba69f59c0fa5f85e650345a2747d6eab04d188a2f21dba913a3316b08213c2560acb7ba0ffeec22b9d1e73c0b3b
7
+ data.tar.gz: 45514fc41bd3b3cc2116dd1937c0f441bdad2f350294394ff2c1419df38636adb7fab8dd54b202d497b7a8fcd0ea8f0ecf58ad5f7ecc153babd3a92becc1a066
data/Gemfile CHANGED
@@ -1,13 +1,13 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem 'grpc', '~> 1.10.0'
3
+ gem 'grpc', '~> 1.11.0'
4
4
  gem 'concurrent-ruby', '~> 1.0', '>= 1.0.5'
5
5
 
6
6
  group :development do
7
- gem 'grpc-tools', '~> 1.10.0'
7
+ gem 'grpc-tools', '~> 1.11.0'
8
8
  gem "shoulda", ">= 0"
9
9
  gem "rdoc", "~> 3.12"
10
10
  gem "bundler", "~> 1.0"
11
- gem "juwelier", "~> 2.1.0"
11
+ gem "juwelier", "~> 2.4.9"
12
12
  gem "simplecov", ">= 0"
13
13
  end
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- activesupport (5.1.4)
4
+ activesupport (5.2.0)
5
5
  concurrent-ruby (~> 1.0, >= 1.0.2)
6
- i18n (~> 0.7)
6
+ i18n (>= 0.7, < 2)
7
7
  minitest (~> 5.1)
8
8
  tzinfo (~> 1.1)
9
9
  addressable (2.5.2)
@@ -12,7 +12,7 @@ GEM
12
12
  concurrent-ruby (1.0.5)
13
13
  descendants_tracker (0.0.4)
14
14
  thread_safe (~> 0.3, >= 0.3.1)
15
- docile (1.1.5)
15
+ docile (1.3.0)
16
16
  faraday (0.12.2)
17
17
  multipart-post (>= 1.2, < 3)
18
18
  git (1.3.0)
@@ -33,38 +33,42 @@ GEM
33
33
  multi_json (~> 1.11)
34
34
  os (~> 0.9)
35
35
  signet (~> 0.7)
36
- grpc (1.10.0)
36
+ grpc (1.11.0)
37
37
  google-protobuf (~> 3.1)
38
38
  googleapis-common-protos-types (~> 1.0.0)
39
39
  googleauth (>= 0.5.1, < 0.7)
40
- grpc-tools (1.10.0)
41
- hashie (3.5.6)
40
+ grpc-tools (1.11.0)
41
+ hashie (3.5.7)
42
42
  highline (1.7.10)
43
- i18n (0.9.1)
43
+ i18n (1.0.1)
44
44
  concurrent-ruby (~> 1.0)
45
45
  json (1.8.6)
46
- juwelier (2.1.3)
46
+ juwelier (2.4.9)
47
47
  builder
48
- bundler (>= 1.13)
49
- git (>= 1.2.5)
48
+ bundler
49
+ git
50
50
  github_api
51
- highline (>= 1.6.15)
52
- nokogiri (>= 1.5.10)
51
+ highline
52
+ kamelcase (~> 0)
53
+ nokogiri
54
+ psych
53
55
  rake
54
56
  rdoc
55
- semver
57
+ semver2
56
58
  jwt (1.5.6)
59
+ kamelcase (0.0.2)
60
+ semver2 (~> 3)
57
61
  little-plugger (1.1.4)
58
62
  logging (2.2.2)
59
63
  little-plugger (~> 1.1)
60
64
  multi_json (~> 1.10)
61
65
  memoist (0.16.0)
62
66
  mini_portile2 (2.3.0)
63
- minitest (5.10.3)
64
- multi_json (1.12.2)
67
+ minitest (5.11.3)
68
+ multi_json (1.13.1)
65
69
  multi_xml (0.6.0)
66
70
  multipart-post (2.0.0)
67
- nokogiri (1.8.1)
71
+ nokogiri (1.8.2)
68
72
  mini_portile2 (~> 2.3.0)
69
73
  oauth2 (1.4.0)
70
74
  faraday (>= 0.8, < 0.13)
@@ -73,12 +77,13 @@ GEM
73
77
  multi_xml (~> 0.5)
74
78
  rack (>= 1.2, < 3)
75
79
  os (0.9.6)
76
- public_suffix (3.0.1)
77
- rack (2.0.3)
78
- rake (12.3.0)
80
+ psych (3.0.2)
81
+ public_suffix (3.0.2)
82
+ rack (2.0.4)
83
+ rake (12.3.1)
79
84
  rdoc (3.12.2)
80
85
  json (~> 1.4)
81
- semver (1.0.1)
86
+ semver2 (3.4.2)
82
87
  shoulda (3.5.0)
83
88
  shoulda-context (~> 1.0, >= 1.0.1)
84
89
  shoulda-matchers (>= 1.4.1, < 3.0)
@@ -90,13 +95,13 @@ GEM
90
95
  faraday (~> 0.9)
91
96
  jwt (>= 1.5, < 3.0)
92
97
  multi_json (~> 1.10)
93
- simplecov (0.15.1)
94
- docile (~> 1.1.0)
98
+ simplecov (0.16.1)
99
+ docile (~> 1.1)
95
100
  json (>= 1.8, < 3)
96
101
  simplecov-html (~> 0.10.0)
97
102
  simplecov-html (0.10.2)
98
103
  thread_safe (0.3.6)
99
- tzinfo (1.2.4)
104
+ tzinfo (1.2.5)
100
105
  thread_safe (~> 0.1)
101
106
 
102
107
  PLATFORMS
@@ -105,9 +110,9 @@ PLATFORMS
105
110
  DEPENDENCIES
106
111
  bundler (~> 1.0)
107
112
  concurrent-ruby (~> 1.0, >= 1.0.5)
108
- grpc (~> 1.10.0)
109
- grpc-tools (~> 1.10.0)
110
- juwelier (~> 2.1.0)
113
+ grpc (~> 1.11.0)
114
+ grpc-tools (~> 1.11.0)
115
+ juwelier (~> 2.4.9)
111
116
  rdoc (~> 3.12)
112
117
  shoulda
113
118
  simplecov
data/README.md CHANGED
@@ -25,8 +25,23 @@ See full documentation https://www.prefab.cloud/documentation/installation
25
25
  * Infinite retention for [deduplication workflows](https://www.prefab.cloud/documentation/once_and_only_once)
26
26
  * [FeatureFlags](https://www.prefab.cloud/documentation/feature_flags) as a Service
27
27
 
28
+ ## Important note about Forking
28
29
 
29
- ## Contributing to ratelimit-ruby
30
+ Many ruby web servers fork. GRPC does not like to be forked. You should instantiate your prefab clients in the on_worker_boot or after_fork hook of your server. See some details on GRPC and forking: https://github.com/grpc/grpc/issues/7951#issuecomment-335998583
31
+
32
+ ```ruby
33
+ #puma.rb
34
+ on_worker_boot do
35
+ $prefab = Prefab::Client.new(shared_cache: Rails.cache,
36
+ logdev: $stdout,
37
+ log_formatter: proc {|severity, datetime, progname, msg|
38
+ "#{severity.ljust(5)} #{datetime}: #{progname} #{msg}\n"
39
+ })
40
+ Rails.logger = $prefab.log
41
+ end
42
+ ```
43
+
44
+ ## Contributing to prefab-cloud-ruby
30
45
 
31
46
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
32
47
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.20
1
+ 0.0.21
data/lib/prefab/client.rb CHANGED
@@ -14,7 +14,7 @@ module Prefab
14
14
  namespace: "",
15
15
  log_formatter: nil
16
16
  )
17
- raise "No API key. Set PREFAB_API_KEY env var" if api_key.empty?
17
+ raise "No API key. Set PREFAB_API_KEY env var" if api_key.nil? || api_key.empty?
18
18
  @logdev = (logdev || $stdout)
19
19
  @log_formatter = log_formatter
20
20
  @local = local
@@ -41,7 +41,8 @@ module Prefab
41
41
  end
42
42
 
43
43
  def get_user_pct(feature, lookup_key)
44
- int_value = Murmur3.murmur3_32("#{@base_client.account_id}#{feature}#{lookup_key}")
44
+ to_hash = "#{@base_client.account_id}#{feature}#{lookup_key}"
45
+ int_value = Murmur3.murmur3_32(to_hash)
45
46
  int_value / MAX_32_FLOAT
46
47
  end
47
48
 
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: prefab-cloud-ruby 0.0.20 ruby lib
5
+ # stub: prefab-cloud-ruby 0.0.21 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "prefab-cloud-ruby".freeze
9
- s.version = "0.0.20"
9
+ s.version = "0.0.21"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Jeff Dwyer".freeze]
14
- s.date = "2018-04-20"
14
+ s.date = "2018-05-03"
15
15
  s.description = "RateLimits & Config as a service".freeze
16
16
  s.email = "jdwyer@prefab.cloud".freeze
17
17
  s.extra_rdoc_files = [
@@ -58,32 +58,32 @@ Gem::Specification.new do |s|
58
58
  s.specification_version = 4
59
59
 
60
60
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
61
- s.add_runtime_dependency(%q<grpc>.freeze, ["~> 1.10.0"])
61
+ s.add_runtime_dependency(%q<grpc>.freeze, ["~> 1.11.0"])
62
62
  s.add_runtime_dependency(%q<concurrent-ruby>.freeze, [">= 1.0.5", "~> 1.0"])
63
- s.add_development_dependency(%q<grpc-tools>.freeze, ["~> 1.10.0"])
63
+ s.add_development_dependency(%q<grpc-tools>.freeze, ["~> 1.11.0"])
64
64
  s.add_development_dependency(%q<shoulda>.freeze, [">= 0"])
65
65
  s.add_development_dependency(%q<rdoc>.freeze, ["~> 3.12"])
66
66
  s.add_development_dependency(%q<bundler>.freeze, ["~> 1.0"])
67
- s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.1.0"])
67
+ s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
68
68
  s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
69
69
  else
70
- s.add_dependency(%q<grpc>.freeze, ["~> 1.10.0"])
70
+ s.add_dependency(%q<grpc>.freeze, ["~> 1.11.0"])
71
71
  s.add_dependency(%q<concurrent-ruby>.freeze, [">= 1.0.5", "~> 1.0"])
72
- s.add_dependency(%q<grpc-tools>.freeze, ["~> 1.10.0"])
72
+ s.add_dependency(%q<grpc-tools>.freeze, ["~> 1.11.0"])
73
73
  s.add_dependency(%q<shoulda>.freeze, [">= 0"])
74
74
  s.add_dependency(%q<rdoc>.freeze, ["~> 3.12"])
75
75
  s.add_dependency(%q<bundler>.freeze, ["~> 1.0"])
76
- s.add_dependency(%q<juwelier>.freeze, ["~> 2.1.0"])
76
+ s.add_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
77
77
  s.add_dependency(%q<simplecov>.freeze, [">= 0"])
78
78
  end
79
79
  else
80
- s.add_dependency(%q<grpc>.freeze, ["~> 1.10.0"])
80
+ s.add_dependency(%q<grpc>.freeze, ["~> 1.11.0"])
81
81
  s.add_dependency(%q<concurrent-ruby>.freeze, [">= 1.0.5", "~> 1.0"])
82
- s.add_dependency(%q<grpc-tools>.freeze, ["~> 1.10.0"])
82
+ s.add_dependency(%q<grpc-tools>.freeze, ["~> 1.11.0"])
83
83
  s.add_dependency(%q<shoulda>.freeze, [">= 0"])
84
84
  s.add_dependency(%q<rdoc>.freeze, ["~> 3.12"])
85
85
  s.add_dependency(%q<bundler>.freeze, ["~> 1.0"])
86
- s.add_dependency(%q<juwelier>.freeze, ["~> 2.1.0"])
86
+ s.add_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
87
87
  s.add_dependency(%q<simplecov>.freeze, [">= 0"])
88
88
  end
89
89
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prefab-cloud-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dwyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-20 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.10.0
19
+ version: 1.11.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.10.0
26
+ version: 1.11.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: concurrent-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 1.10.0
53
+ version: 1.11.0
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 1.10.0
60
+ version: 1.11.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: shoulda
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +106,14 @@ dependencies:
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: 2.1.0
109
+ version: 2.4.9
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: 2.1.0
116
+ version: 2.4.9
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: simplecov
119
119
  requirement: !ruby/object:Gem::Requirement