flipper 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/.github/workflows/examples.yml +1 -1
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/lib/flipper/adapter_builder.rb +1 -1
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/adapters/strict_spec.rb +2 -2
- data/spec/flipper/engine_spec.rb +7 -7
- data/spec/flipper/middleware/memoizer_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- data/spec/support/fail_on_output.rb +1 -1
- data/spec/support/spec_helpers.rb +13 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29d129fae3234365cc1a38cbe05d41ee04ce2d7bd350ae05f2a3b1546ec757b2
|
4
|
+
data.tar.gz: 184b524b7d42865e223d6018a4ff366553e54f1395723ded4ff1804d6e27f325
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5776ffb099fb4908635146bccd533bdae4cafe708946d1d8f9f3e0876f9bbc94d29971fd938fd471fc463dab41c2deb11c1b2f56e873fdbe0151b235974e42e
|
7
|
+
data.tar.gz: 649abbcce3d804cdc141fbd74d6279ddb0a54d4ed506b6c594182adcf44ce459b4e9c3aa74005dc772da54bfcb9bcf8f324a3565c06493d090885c1f53339ed6
|
data/.github/workflows/ci.yml
CHANGED
@@ -70,7 +70,7 @@ jobs:
|
|
70
70
|
- name: Setup memcached
|
71
71
|
uses: KeisukeYamashita/memcached-actions@v1
|
72
72
|
- name: Start MongoDB
|
73
|
-
uses: supercharge/mongodb-github-action@
|
73
|
+
uses: supercharge/mongodb-github-action@1.11.0
|
74
74
|
with:
|
75
75
|
mongodb-version: 4.0
|
76
76
|
- name: Check out repository code
|
@@ -52,7 +52,7 @@ jobs:
|
|
52
52
|
- name: Setup memcached
|
53
53
|
uses: KeisukeYamashita/memcached-actions@v1
|
54
54
|
- name: Start MongoDB
|
55
|
-
uses: supercharge/mongodb-github-action@
|
55
|
+
uses: supercharge/mongodb-github-action@1.11.0
|
56
56
|
with:
|
57
57
|
mongodb-version: 4.0
|
58
58
|
- name: Check out repository code
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[![Flipper Mark](docs/images/banner.jpg)](https://www.flippercloud.io)
|
2
2
|
|
3
|
-
[Website](https://flippercloud.io?utm_source=oss&utm_medium=readme&utm_campaign=website_link) | [Documentation](https://flippercloud.io/docs?utm_source=oss&utm_medium=readme&utm_campaign=docs_link) | [Examples](examples) | [Twitter](https://twitter.com/flipper_cloud) | [Ruby.social](https://ruby.social/@flipper)
|
3
|
+
[Website](https://flippercloud.io?utm_source=oss&utm_medium=readme&utm_campaign=website_link) | [Documentation](https://flippercloud.io/docs?utm_source=oss&utm_medium=readme&utm_campaign=docs_link) | [Examples](examples) | [Chat](https://chat.flippercloud.io/join/xjHq-aJsA-BeZH) | [Twitter](https://twitter.com/flipper_cloud) | [Ruby.social](https://ruby.social/@flipper)
|
4
4
|
|
5
5
|
# Flipper
|
6
6
|
|
data/Rakefile
CHANGED
@@ -17,7 +17,7 @@ end
|
|
17
17
|
|
18
18
|
desc 'Tags version, pushes to remote, and pushes gem'
|
19
19
|
task release: :build do
|
20
|
-
sh 'git', 'tag', "v#{Flipper::VERSION}"
|
20
|
+
# sh 'git', 'tag', "v#{Flipper::VERSION}"
|
21
21
|
sh 'git push origin main'
|
22
22
|
sh "git push origin v#{Flipper::VERSION}"
|
23
23
|
puts "\nWhat OTP code should be used?"
|
data/lib/flipper/version.rb
CHANGED
@@ -29,13 +29,13 @@ RSpec.describe Flipper::Adapters::Strict do
|
|
29
29
|
|
30
30
|
context "#get" do
|
31
31
|
it "raises an error for unknown feature" do
|
32
|
-
expect(
|
32
|
+
expect(capture_output { subject.get(feature) }).to match(/Could not find feature "unknown"/)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
context "#get_multi" do
|
37
37
|
it "raises an error for unknown feature" do
|
38
|
-
expect(
|
38
|
+
expect(capture_output { subject.get_multi([feature]) }).to match(/Could not find feature "unknown"/)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
data/spec/flipper/engine_spec.rb
CHANGED
@@ -29,7 +29,7 @@ RSpec.describe Flipper::Engine do
|
|
29
29
|
|
30
30
|
let(:config) { application.config.flipper }
|
31
31
|
|
32
|
-
subject { application.initialize! }
|
32
|
+
subject { SpecHelpers.silence { application.initialize! } }
|
33
33
|
|
34
34
|
shared_examples 'config.strict' do
|
35
35
|
let(:adapter) { Flipper.adapter.adapter }
|
@@ -233,7 +233,7 @@ RSpec.describe Flipper::Engine do
|
|
233
233
|
it "initializes cloud configuration" do
|
234
234
|
stub_request(:get, /flippercloud\.io/).to_return(status: 200, body: "{}")
|
235
235
|
|
236
|
-
application.initialize!
|
236
|
+
silence { application.initialize! }
|
237
237
|
|
238
238
|
expect(Flipper.instance).to be_a(Flipper::Cloud::DSL)
|
239
239
|
expect(Flipper.instance.instrumenter).to be_a(Flipper::Cloud::Telemetry::Instrumenter)
|
@@ -263,7 +263,7 @@ RSpec.describe Flipper::Engine do
|
|
263
263
|
}
|
264
264
|
|
265
265
|
it "configures webhook app" do
|
266
|
-
application.initialize!
|
266
|
+
silence { application.initialize! }
|
267
267
|
|
268
268
|
stub = stub_request(:get, "https://www.flippercloud.io/adapter/features?exclude_gate_names=true").with({
|
269
269
|
headers: { "flipper-cloud-token" => ENV["FLIPPER_CLOUD_TOKEN"] },
|
@@ -278,7 +278,7 @@ RSpec.describe Flipper::Engine do
|
|
278
278
|
|
279
279
|
context "without CLOUD_SYNC_SECRET" do
|
280
280
|
it "does not configure webhook app" do
|
281
|
-
application.initialize!
|
281
|
+
silence { application.initialize! }
|
282
282
|
|
283
283
|
post "/_flipper"
|
284
284
|
expect(last_response.status).to eq(404)
|
@@ -288,7 +288,7 @@ RSpec.describe Flipper::Engine do
|
|
288
288
|
context "without FLIPPER_CLOUD_TOKEN" do
|
289
289
|
it "gracefully skips configuring webhook app" do
|
290
290
|
ENV["FLIPPER_CLOUD_TOKEN"] = nil
|
291
|
-
application.initialize!
|
291
|
+
silence { application.initialize! }
|
292
292
|
expect(Flipper.instance).to be_a(Flipper::DSL)
|
293
293
|
|
294
294
|
post "/_flipper"
|
@@ -324,7 +324,7 @@ RSpec.describe Flipper::Engine do
|
|
324
324
|
end
|
325
325
|
|
326
326
|
it "enables cloud" do
|
327
|
-
application.initialize!
|
327
|
+
silence { application.initialize! }
|
328
328
|
expect(ENV["FLIPPER_CLOUD_TOKEN"]).to eq("credentials-token")
|
329
329
|
expect(ENV["FLIPPER_CLOUD_SYNC_SECRET"]).to eq("credentials-secret")
|
330
330
|
expect(Flipper.instance).to be_a(Flipper::Cloud::DSL)
|
@@ -339,7 +339,7 @@ RSpec.describe Flipper::Engine do
|
|
339
339
|
|
340
340
|
describe "config.actor_limit" do
|
341
341
|
let(:adapter) do
|
342
|
-
application.initialize!
|
342
|
+
silence { application.initialize! }
|
343
343
|
Flipper.adapter.adapter.adapter
|
344
344
|
end
|
345
345
|
|
@@ -285,7 +285,7 @@ RSpec.describe Flipper::Middleware::Memoizer do
|
|
285
285
|
end
|
286
286
|
|
287
287
|
def get(uri, params = {}, env = {}, &block)
|
288
|
-
|
288
|
+
capture_output { super(uri, params, env, &block) }
|
289
289
|
end
|
290
290
|
|
291
291
|
include_examples 'flipper middleware'
|
data/spec/spec_helper.rb
CHANGED
@@ -27,6 +27,9 @@ ENV["FLIPPER_CLOUD_LOGGING_ENABLED"] = "false"
|
|
27
27
|
|
28
28
|
RSpec.configure do |config|
|
29
29
|
config.before(:example) do
|
30
|
+
# default stub for telemetry
|
31
|
+
stub_request(:post, "https://www.flippercloud.io/adapter/telemetry").
|
32
|
+
to_return(status: 200, body: "", headers: {})
|
30
33
|
Flipper::Cloud::Telemetry.reset if defined?(Flipper::Cloud::Telemetry) && Flipper::Cloud::Telemetry.respond_to?(:reset)
|
31
34
|
Flipper::Poller.reset if defined?(Flipper::Poller)
|
32
35
|
Flipper.unregister_groups
|
@@ -1,7 +1,7 @@
|
|
1
1
|
if ENV["CI"] || ENV["FAIL_ON_OUTPUT"]
|
2
2
|
RSpec.configure do |config|
|
3
3
|
config.around do |example|
|
4
|
-
output =
|
4
|
+
output = capture_output { example.run }
|
5
5
|
fail "Use `silence { }` to avoid printing to STDOUT/STDERR\n#{output}" unless output.empty?
|
6
6
|
end
|
7
7
|
end
|
@@ -79,11 +79,22 @@ module SpecHelpers
|
|
79
79
|
original_stdout = $stdout
|
80
80
|
|
81
81
|
# Redirect stderr and stdout
|
82
|
-
|
82
|
+
$stderr = $stdout = StringIO.new
|
83
|
+
|
84
|
+
yield
|
85
|
+
ensure
|
86
|
+
$stderr = original_stderr
|
87
|
+
$stdout = original_stdout
|
88
|
+
end
|
89
|
+
|
90
|
+
def capture_output
|
91
|
+
original_stderr = $stderr
|
92
|
+
original_stdout = $stdout
|
93
|
+
|
94
|
+
output = $stdout = $stderr = StringIO.new
|
83
95
|
|
84
96
|
yield
|
85
97
|
|
86
|
-
# Return output
|
87
98
|
output.string
|
88
99
|
ensure
|
89
100
|
$stderr = original_stderr
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04
|
11
|
+
date: 2024-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -314,7 +314,7 @@ metadata:
|
|
314
314
|
homepage_uri: https://www.flippercloud.io
|
315
315
|
source_code_uri: https://github.com/flippercloud/flipper
|
316
316
|
bug_tracker_uri: https://github.com/flippercloud/flipper/issues
|
317
|
-
changelog_uri: https://github.com/flippercloud/flipper/releases/tag/v1.3.
|
317
|
+
changelog_uri: https://github.com/flippercloud/flipper/releases/tag/v1.3.1
|
318
318
|
post_install_message:
|
319
319
|
rdoc_options: []
|
320
320
|
require_paths:
|
@@ -330,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
330
330
|
- !ruby/object:Gem::Version
|
331
331
|
version: '0'
|
332
332
|
requirements: []
|
333
|
-
rubygems_version: 3.5.
|
333
|
+
rubygems_version: 3.5.18
|
334
334
|
signing_key:
|
335
335
|
specification_version: 4
|
336
336
|
summary: Beautiful, performant feature flags for Ruby and Rails.
|