eight_ball 2.2.1 → 3.0.1

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
  SHA256:
3
- metadata.gz: c05f1bec9958e4b2602bc9559ff20c54bddbfecbc791b25ade0996ca854a61f7
4
- data.tar.gz: 7f8ee4370d9a1d1d935442623f847cad7b75b96ca8c497525ef704e715376dcf
3
+ metadata.gz: fa845dab485f3d2165d963ae5dfea42156b1d6e843a53737d570080baba2ca14
4
+ data.tar.gz: a764d87244a2d889590ac2c649497204ee111f42c0b57d98b42d8c419279c492
5
5
  SHA512:
6
- metadata.gz: b507c5aec0f43afad5d2f25541ebb9939be8478e9d0e5feac685a06c19b5433dd3c62d01270aa5843fd5836054f28cb860bc4df2bec808dc083f6e82696508e6
7
- data.tar.gz: 1205c3924565b64c8d86eb4bed1ca0b7e67e1f16bd3c0c0c61c7b48501fb419575dbff352692573c03ab42c2266ac26fce8e6e470bc67d0745eac6cb63c07a84
6
+ metadata.gz: 32f551d78e14441c94e65b285d84f81009207dffe4bc647b21a661433a5ace3ff827c98c34ee361c41634c89b6b0d2a89b8a5fa73a00e9106f76ad4ce7ed7f7a
7
+ data.tar.gz: 3290e0a46ef183c241920f8ab9e235b20b63f8c13cd9716645fbc37f1a5dabba637290d18da70bece2005d877bb1f096b8edcd35018b57036bb14241c6b2b638
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.0.1]
4
+
5
+ - Fix release workflow to use ruby/setup-ruby instead of actions/setup-ruby
6
+
7
+ ## [3.0.0]
8
+
9
+ - Update to ruby 3.2.8
10
+ - Address deprecation warning for URI.regexp for ruby 3.2 and 3.4
11
+ - Update to bundler 2
12
+
3
13
  ## [2.2.1]
4
14
 
5
15
  - Switch release to github actions
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eight_ball (2.2.0)
4
+ eight_ball (3.0.1)
5
5
  awrence (~> 1.1)
6
+ logger (~> 1.7)
6
7
  plissken (~> 1.2)
7
8
 
8
9
  GEM
@@ -10,37 +11,38 @@ GEM
10
11
  specs:
11
12
  ansi (1.5.0)
12
13
  awrence (1.1.1)
13
- byebug (11.1.3)
14
+ byebug (12.0.0)
14
15
  coderay (1.1.3)
15
- diff-lcs (1.3)
16
+ diff-lcs (1.6.1)
16
17
  docile (1.3.2)
17
18
  inch (0.8.0)
18
19
  pry
19
20
  sparkr (>= 0.2.0)
20
21
  term-ansicolor
21
22
  yard (~> 0.9.12)
22
- method_source (1.0.0)
23
+ logger (1.7.0)
24
+ method_source (1.1.0)
23
25
  plissken (1.3.1)
24
- pry (0.13.1)
26
+ pry (0.15.2)
25
27
  coderay (~> 1.1)
26
28
  method_source (~> 1.0)
27
- pry-byebug (3.9.0)
28
- byebug (~> 11.0)
29
- pry (~> 0.13.0)
29
+ pry-byebug (3.11.0)
30
+ byebug (~> 12.0)
31
+ pry (>= 0.13, < 0.16)
30
32
  rake (13.0.1)
31
33
  rspec (3.9.0)
32
34
  rspec-core (~> 3.9.0)
33
35
  rspec-expectations (~> 3.9.0)
34
36
  rspec-mocks (~> 3.9.0)
35
- rspec-core (3.9.2)
37
+ rspec-core (3.9.3)
36
38
  rspec-support (~> 3.9.3)
37
- rspec-expectations (3.9.2)
39
+ rspec-expectations (3.9.4)
38
40
  diff-lcs (>= 1.2.0, < 2.0)
39
41
  rspec-support (~> 3.9.0)
40
42
  rspec-mocks (3.9.1)
41
43
  diff-lcs (>= 1.2.0, < 2.0)
42
44
  rspec-support (~> 3.9.0)
43
- rspec-support (3.9.3)
45
+ rspec-support (3.9.4)
44
46
  simplecov (0.18.5)
45
47
  docile (~> 1.1)
46
48
  simplecov-html (~> 0.11)
@@ -48,7 +50,7 @@ GEM
48
50
  ansi
49
51
  simplecov
50
52
  terminal-table
51
- simplecov-html (0.12.2)
53
+ simplecov-html (0.13.1)
52
54
  sparkr (0.4.1)
53
55
  sync (0.5.0)
54
56
  term-ansicolor (1.7.1)
@@ -58,13 +60,13 @@ GEM
58
60
  tins (1.25.0)
59
61
  sync
60
62
  unicode-display_width (1.7.0)
61
- yard (0.9.25)
63
+ yard (0.9.37)
62
64
 
63
65
  PLATFORMS
64
66
  ruby
65
67
 
66
68
  DEPENDENCIES
67
- bundler (~> 1.17)
69
+ bundler (~> 2)
68
70
  eight_ball!
69
71
  inch (~> 0.8)
70
72
  pry-byebug (~> 3.6)
@@ -74,4 +76,4 @@ DEPENDENCIES
74
76
  simplecov-console (~> 0.4)
75
77
 
76
78
  BUNDLED WITH
77
- 1.17.2
79
+ 2.6.7
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # EightBall
2
- [![Build Status](https://travis-ci.org/rewindio/eight_ball.svg?branch=dev)](https://travis-ci.org/rewindio/eight_ball)
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/eight_ball.png)](https://badge.fury.io/rb/eight_ball) ![Build](https://github.com/rewindio/eight_ball/workflows/tag-and-release/badge.svg)
3
4
 
4
5
  EightBall is a feature toggle querying gem
5
6
 
@@ -13,14 +14,19 @@ gem 'eight_ball'
13
14
 
14
15
  And then execute:
15
16
 
16
- $ bundle
17
+ ```ruby
18
+ bundle
19
+ ```
17
20
 
18
21
  Or install it yourself as:
19
22
 
20
- $ gem install eight_ball
23
+ ```ruby
24
+ gem install eight_ball
25
+ ```
21
26
 
22
27
  ## Example Usage
23
- ```
28
+
29
+ ```ruby
24
30
  require 'eight_ball'
25
31
 
26
32
  # This could be read from the filesystem or be the response from an external service, etc.
@@ -58,37 +64,47 @@ More examples [here](examples)
58
64
  ## Concepts
59
65
 
60
66
  ### Feature
67
+
61
68
  A Feature is a part of your application that can be enabled or disabled based on various conditions. It has the following attributes:
69
+
62
70
  - `name`: The unique name of the Feature.
63
71
  - `enabledFor`: An array of Conditions for which the Feature is enabled.
64
72
  - `disabledFor`: An array of Conditions for which the Feature is disabled.
65
73
 
66
74
  ### Condition
75
+
67
76
  A Condition must either be `true` or `false`. It describes when a Feature is enabled or disabled.
68
77
 
69
- **Supported Conditions**
78
+ #### Supported Conditions
79
+
70
80
  - [Always](lib/eight_ball/conditions/always.rb): This condition is always satisfied.
71
81
  - [List](lib/eight_ball/conditions/list.rb): This condition is satisfied if the given value belongs to its list of accepted values.
72
82
  - [Never](lib/eight_ball/conditions/never.rb): This condition is never satisfied.
73
83
  - [Range](lib/eight_ball/conditions/range.rb): This condition is satisfied if the given value is within the specified range (inclusive).
74
84
 
75
85
  ### Provider
86
+
76
87
  A Provider is able to give EightBall the list of Features it needs to answer queries.
77
88
 
78
- **Supported Providers**
89
+ #### Supported Providers
90
+
79
91
  - [HTTP](lib/eight_ball/providers/http.rb): Connect to a URL and use the given Marshaller to convert the response into a list of Features.
80
92
  - [Static](lib/eight_ball/providers/static.rb): Once initialized with a list of Features, always provides that same list of Features.
81
93
 
82
- #### RefreshPolicies
94
+ ### RefreshPolicies
95
+
83
96
  Some Providers are able to automatically "refresh" their list of Features using a RefreshPolicy.
84
97
 
85
- **Supported RefreshPolicies**
98
+ #### Supported RefreshPolicies
99
+
86
100
  - [Interval](lib/eight_ball/providers/refresh_policies/interval.rb): The data is considered fresh for a given number of seconds, after which it is considered stale and should be refreshed.
87
101
 
88
102
  ### Marshallers
103
+
89
104
  A Marshaller converts Features to and from another format.
90
105
 
91
- **Supported Marshaller**
106
+ #### Supported Marshaller
107
+
92
108
  - [JSON](lib/eight_ball/marshallers/json.rb)
93
109
 
94
110
  ## Development
@@ -98,6 +114,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
98
114
  To install this gem onto your local machine, run `bundle exec rake install`.
99
115
 
100
116
  ### Documenting
117
+
101
118
  Documentation is written using [yard](https://yardoc.org/) syntax. You can view the generated docs by running `yard server` and going to `http://127.0.0.1:8808/docs/EightBall`
102
119
 
103
120
  ## Contributing
data/eight_ball.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = 'https://github.com/rewindio/eight_ball'
16
16
  spec.license = 'MIT'
17
17
 
18
- spec.required_ruby_version = '>= 2.5.0'
18
+ spec.required_ruby_version = '~> 3.1'
19
19
 
20
20
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|.github|examples)/}) }
21
21
  spec.bindir = 'exe'
@@ -26,9 +26,10 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_dependency 'awrence', '~> 1.1'
28
28
  spec.add_dependency 'plissken', '~> 1.2'
29
+ spec.add_dependency 'logger', '~> 1.7'
29
30
 
30
31
  # Development
31
- spec.add_development_dependency 'bundler', '~> 1.17'
32
+ spec.add_development_dependency 'bundler', '~> 2'
32
33
  spec.add_development_dependency 'inch', '~> 0.8'
33
34
  spec.add_development_dependency 'pry-byebug', '~> 3.6'
34
35
  spec.add_development_dependency 'rake', '~> 13.0'
@@ -12,6 +12,9 @@ module EightBall::Providers
12
12
  class Http
13
13
  SUPPORTED_SCHEMES = %w[http https].freeze
14
14
 
15
+ URI_PARSER = defined?(::URI::RFC2396_PARSER) ? ::URI::RFC2396_PARSER : ::URI::DEFAULT_PARSER
16
+ private_constant :URI_PARSER
17
+
15
18
  attr_reader :marshaller
16
19
 
17
20
  # @param uri [String] The URI to GET the {EightBall::Feature Features} from.
@@ -34,7 +37,7 @@ module EightBall::Providers
34
37
  # refresh_policy: EightBall::Providers::RefreshPolicies::Interval.new 120
35
38
  # )
36
39
  def initialize(uri, options = {})
37
- raise ArgumentError, 'Invalid HTTP/HTTPS URI provided' unless uri =~ URI.regexp(SUPPORTED_SCHEMES)
40
+ raise ArgumentError, 'Invalid HTTP/HTTPS URI provided' unless uri =~ URI_PARSER.make_regexp(SUPPORTED_SCHEMES)
38
41
 
39
42
  @uri = URI.parse uri
40
43
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EightBall
4
- VERSION = '2.2.1'
4
+ VERSION = '3.0.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eight_ball
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rewind.io
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-25 00:00:00.000000000 Z
11
+ date: 2025-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awrence
@@ -38,20 +38,34 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: logger
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.7'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.7'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '1.17'
61
+ version: '2'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '1.17'
68
+ version: '2'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: inch
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -145,6 +159,7 @@ extra_rdoc_files: []
145
159
  files:
146
160
  - ".gitignore"
147
161
  - ".rspec"
162
+ - ".ruby-version"
148
163
  - CHANGELOG.md
149
164
  - Gemfile
150
165
  - Gemfile.lock
@@ -172,23 +187,23 @@ homepage: https://github.com/rewindio/eight_ball
172
187
  licenses:
173
188
  - MIT
174
189
  metadata: {}
175
- post_install_message:
190
+ post_install_message:
176
191
  rdoc_options: []
177
192
  require_paths:
178
193
  - lib
179
194
  required_ruby_version: !ruby/object:Gem::Requirement
180
195
  requirements:
181
- - - ">="
196
+ - - "~>"
182
197
  - !ruby/object:Gem::Version
183
- version: 2.5.0
198
+ version: '3.1'
184
199
  required_rubygems_version: !ruby/object:Gem::Requirement
185
200
  requirements:
186
201
  - - ">="
187
202
  - !ruby/object:Gem::Version
188
203
  version: '0'
189
204
  requirements: []
190
- rubygems_version: 3.0.3
191
- signing_key:
205
+ rubygems_version: 3.4.19
206
+ signing_key:
192
207
  specification_version: 4
193
208
  summary: The most cost efficient way to flag features
194
209
  test_files: []