eight_ball 2.2.0 → 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 +4 -4
- data/.ruby-version +1 -0
- data/CHANGELOG.md +29 -7
- data/Gemfile.lock +17 -15
- data/README.md +26 -9
- data/eight_ball.gemspec +3 -2
- data/lib/eight_ball/providers/http.rb +4 -1
- data/lib/eight_ball/version.rb +1 -1
- metadata +25 -12
- data/.travis.yml +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa845dab485f3d2165d963ae5dfea42156b1d6e843a53737d570080baba2ca14
|
4
|
+
data.tar.gz: a764d87244a2d889590ac2c649497204ee111f42c0b57d98b42d8c419279c492
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,30 +1,52 @@
|
|
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
|
+
|
13
|
+
## [2.2.1]
|
14
|
+
|
15
|
+
- Switch release to github actions
|
16
|
+
|
3
17
|
## [2.2.0]
|
4
|
-
|
18
|
+
|
19
|
+
- Add `==` to `Feature` and `Conditions`
|
5
20
|
|
6
21
|
## [2.1.0]
|
7
|
-
|
22
|
+
|
23
|
+
- Add `features` parameter to `EightBall.marshall` to allow marshalling any Features, not just the ones
|
8
24
|
from the configured Provider.
|
9
25
|
|
10
26
|
## [2.0.0]
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
27
|
+
|
28
|
+
- [BREAKING] `Parsers` have been replaced with `Marshallers`, allowing bi-directional conversions
|
29
|
+
- Added `EightBall.marshall` as a way to output the Feature list to an external format (e.g. to create a JSON file)
|
30
|
+
- Added `EightBall.features` as a shortcut to `EightBall.provider.features`
|
31
|
+
- Testing framework has been moved from Minitest to rspec
|
32
|
+
- Updated dev dependencies
|
16
33
|
|
17
34
|
## [1.0.5]
|
35
|
+
|
18
36
|
Security: Update rake to >= 12.3.3
|
19
37
|
|
20
38
|
## [1.0.3]
|
39
|
+
|
21
40
|
Update .travis.yml
|
22
41
|
|
23
42
|
## [1.0.2]
|
43
|
+
|
24
44
|
Update .travis.yml
|
25
45
|
|
26
46
|
## [1.0.1]
|
47
|
+
|
27
48
|
Security: Update yard 0.9.16 -> 0.9.20
|
28
49
|
|
29
50
|
## [1.0.0]
|
51
|
+
|
30
52
|
Initial release!
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eight_ball (
|
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 (
|
14
|
+
byebug (12.0.0)
|
14
15
|
coderay (1.1.3)
|
15
|
-
diff-lcs (1.
|
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
|
-
|
23
|
+
logger (1.7.0)
|
24
|
+
method_source (1.1.0)
|
23
25
|
plissken (1.3.1)
|
24
|
-
pry (0.
|
26
|
+
pry (0.15.2)
|
25
27
|
coderay (~> 1.1)
|
26
28
|
method_source (~> 1.0)
|
27
|
-
pry-byebug (3.
|
28
|
-
byebug (~>
|
29
|
-
pry (
|
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.
|
37
|
+
rspec-core (3.9.3)
|
36
38
|
rspec-support (~> 3.9.3)
|
37
|
-
rspec-expectations (3.9.
|
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.
|
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.
|
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.
|
63
|
+
yard (0.9.37)
|
62
64
|
|
63
65
|
PLATFORMS
|
64
66
|
ruby
|
65
67
|
|
66
68
|
DEPENDENCIES
|
67
|
-
bundler (~>
|
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
|
-
|
79
|
+
2.6.7
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# EightBall
|
2
|
-
|
2
|
+
|
3
|
+
[](https://badge.fury.io/rb/eight_ball) 
|
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
|
-
|
17
|
+
```ruby
|
18
|
+
bundle
|
19
|
+
```
|
17
20
|
|
18
21
|
Or install it yourself as:
|
19
22
|
|
20
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
94
|
+
### RefreshPolicies
|
95
|
+
|
83
96
|
Some Providers are able to automatically "refresh" their list of Features using a RefreshPolicy.
|
84
97
|
|
85
|
-
|
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
|
-
|
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 = '
|
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', '~>
|
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 =~
|
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
|
|
data/lib/eight_ball/version.rb
CHANGED
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:
|
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:
|
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: '
|
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: '
|
68
|
+
version: '2'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: inch
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,7 +159,7 @@ extra_rdoc_files: []
|
|
145
159
|
files:
|
146
160
|
- ".gitignore"
|
147
161
|
- ".rspec"
|
148
|
-
- ".
|
162
|
+
- ".ruby-version"
|
149
163
|
- CHANGELOG.md
|
150
164
|
- Gemfile
|
151
165
|
- Gemfile.lock
|
@@ -173,24 +187,23 @@ homepage: https://github.com/rewindio/eight_ball
|
|
173
187
|
licenses:
|
174
188
|
- MIT
|
175
189
|
metadata: {}
|
176
|
-
post_install_message:
|
190
|
+
post_install_message:
|
177
191
|
rdoc_options: []
|
178
192
|
require_paths:
|
179
193
|
- lib
|
180
194
|
required_ruby_version: !ruby/object:Gem::Requirement
|
181
195
|
requirements:
|
182
|
-
- - "
|
196
|
+
- - "~>"
|
183
197
|
- !ruby/object:Gem::Version
|
184
|
-
version:
|
198
|
+
version: '3.1'
|
185
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
200
|
requirements:
|
187
201
|
- - ">="
|
188
202
|
- !ruby/object:Gem::Version
|
189
203
|
version: '0'
|
190
204
|
requirements: []
|
191
|
-
|
192
|
-
|
193
|
-
signing_key:
|
205
|
+
rubygems_version: 3.4.19
|
206
|
+
signing_key:
|
194
207
|
specification_version: 4
|
195
208
|
summary: The most cost efficient way to flag features
|
196
209
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
cache: bundler
|
4
|
-
rvm:
|
5
|
-
- 2.5.0
|
6
|
-
before_install: gem install bundler -v 1.17.2
|
7
|
-
deploy:
|
8
|
-
provider: rubygems
|
9
|
-
api_key:
|
10
|
-
secure: fHXG5wBNcGRqpznLCCHfgwKEL1UXf0CNjou+HUdLJgLDwHaJro5TxM/c9z0Pnb9OJE0KIydVaIKh3iX0VtH1gS4m3ZztSpb5tnu4kkwAfdqG6QXVyubatxL/NQKTZSv6IzUjK/SC1eUePFMUu64Kx6voe8B1ZwoAGVf6L+atektcGb0PhZ24ogNFQaNUC3QJVPYyVKHLD8hZv6GVtxHE/xF6yiVhSZ4Mz2vqD4hDMQlkASnFzhhGvBk22aboc9Z0cBeYd2CRICJfyMyjUSmM2cFaeq1IsMJ6p2THoeeHYu8dIE7iiPMh2hMBD+ok+O+5f/8T3MpOdnpaLuq0u/ZkGBjg8oe4TCEQ67IZdIZnsRYEtwqJl//0Tkh9qW6ZZrq9ZHpd8VSXGbJv3eDutytlXNb0YdLXiRrBX72dGH9zheSQHIaBnc5gbSdaTcgqFacdeK3grx1L40SWTVrwBm+Dm88xvGGfPl+Y2sj0dBoPdeZqRfbrztSJivbbbR7XKosyOWQK9LqasPNP5EXjlnJRms6C/15m57RFs0oi/1p1TPAbaLqcp9Xvbwlft6HegCSram9xvd6R9alFgaizS1vLbESOJAQkADA9VN9ERApr38Eum8J6HF2xa/uXn4mHsLXzp5nkYqWb8LRqvxvzAnWL2p553upBTfP4m055jxPGwaM=
|
11
|
-
gem: eight_ball
|
12
|
-
on:
|
13
|
-
tags: true
|
14
|
-
repo: rewindio/eight_ball
|