flipper-cloud 0.14.0 → 0.15.0

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: 24cde6e1e2aacceb9aed8c8154c9d48be2c7c594
4
- data.tar.gz: 421f3876406f2f4502e690fad56e531c4c7ee142
3
+ metadata.gz: a8d4258f0f31b69a1aa4ba0a48ae12f50b569865
4
+ data.tar.gz: 44d4900440fec5582a6b2974843990c61ba26cc5
5
5
  SHA512:
6
- metadata.gz: cb7a3e043e48c6104f7d67628d400f22576ec8405ca79072fc43c6f6640178a289abd80d546fda6bd67efd40f0768acc479352f3fb5c659353caaaa95459ccfa
7
- data.tar.gz: a9b468da4f4d6b75336f0c57710c11bc0d502f5b9a77beb4c7e63ebf29630d875dedc5d8f7c54d836fc330eadf9f9ad834266cc8b3a284195656870da9cb2593
6
+ metadata.gz: 4392a8441376e533ace5bf72bd2d61908b8415574121b8c73e9adc4be62be312677c2addbc8fc2288527becd2ae559fc134167725a81281d4b5154e9453b8721
7
+ data.tar.gz: 4e8cbfe2d07cf7bcd02eaca3c99f93e039b6e3234f9c81d630fbf9ef203c2d48e2c371c4feb10c48087a9cd78d74f3ad871199916269d9452b129102413eb550
@@ -0,0 +1,24 @@
1
+ # Usage (from the repo root):
2
+ # env TOKEN=<token> bundle exec ruby examples/cloud/basic.rb
3
+ require 'pathname'
4
+ require 'logger'
5
+ root_path = Pathname(__FILE__).dirname.join('..').expand_path
6
+ lib_path = root_path.join('lib')
7
+ $:.unshift(lib_path)
8
+
9
+ require 'flipper'
10
+ require 'flipper/adapters/memory'
11
+ require 'flipper/cloud'
12
+
13
+ memory_adapter = Flipper::Adapters::Memory.new
14
+ memory_flipper = Flipper.new(memory_adapter)
15
+
16
+ memory_flipper.enable(:test)
17
+ memory_flipper.enable(:search)
18
+ memory_flipper.enable_actor(:stats, Flipper::Actor.new("jnunemaker"))
19
+ memory_flipper.enable_percentage_of_time(:logging, 5)
20
+
21
+ flipper = Flipper::Cloud.new(ENV.fetch('TOKEN'))
22
+
23
+ # wipes cloud clean and makes it identical to memory flipper
24
+ flipper.import(memory_flipper)
@@ -7,9 +7,9 @@ module Flipper
7
7
  module Cloud
8
8
  class Configuration
9
9
  # The default url should be the one, the only, the website.
10
- DEFAULT_URL = "https://www.featureflipper.com/adapter".freeze
10
+ DEFAULT_URL = "https://www.flippercloud.io/adapter".freeze
11
11
 
12
- # Public: The token corresponding to an environment on featureflipper.com.
12
+ # Public: The token corresponding to an environment on flippercloud.io.
13
13
  attr_accessor :token
14
14
 
15
15
  # Public: The url for http adapter (default: Flipper::Cloud::DEFAULT_URL).
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.14.0'.freeze
2
+ VERSION = '0.15.0'.freeze
3
3
  end
@@ -35,7 +35,7 @@ RSpec.describe Flipper::Cloud::Configuration do
35
35
 
36
36
  it "passes sync_interval into sync adapter" do
37
37
  # The initial sync of http to local invokes this web request.
38
- stub_request(:get, /featureflipper\.com/).to_return(status: 200, body: "{}")
38
+ stub_request(:get, /flippercloud\.io/).to_return(status: 200, body: "{}")
39
39
 
40
40
  instance = described_class.new(required_options.merge(sync_interval: 1))
41
41
  expect(instance.adapter.synchronizer.interval).to be(1)
@@ -48,7 +48,7 @@ RSpec.describe Flipper::Cloud::Configuration do
48
48
 
49
49
  it "defaults adapter block" do
50
50
  # The initial sync of http to local invokes this web request.
51
- stub_request(:get, /featureflipper\.com/).to_return(status: 200, body: "{}")
51
+ stub_request(:get, /flippercloud\.io/).to_return(status: 200, body: "{}")
52
52
 
53
53
  instance = described_class.new(required_options)
54
54
  expect(instance.adapter).to be_instance_of(Flipper::Adapters::Sync)
@@ -56,7 +56,7 @@ RSpec.describe Flipper::Cloud::Configuration do
56
56
 
57
57
  it "can override adapter block" do
58
58
  # The initial sync of http to local invokes this web request.
59
- stub_request(:get, /featureflipper\.com/).to_return(status: 200, body: "{}")
59
+ stub_request(:get, /flippercloud\.io/).to_return(status: 200, body: "{}")
60
60
 
61
61
  instance = described_class.new(required_options)
62
62
  instance.adapter do |adapter|
@@ -5,7 +5,7 @@ require 'flipper/instrumenters/memory'
5
5
 
6
6
  RSpec.describe Flipper::Cloud do
7
7
  before do
8
- stub_request(:get, /featureflipper\.com/).to_return(status: 200, body: "{}")
8
+ stub_request(:get, /flippercloud\.io/).to_return(status: 200, body: "{}")
9
9
  end
10
10
 
11
11
  context "initialize with token" do
@@ -30,7 +30,7 @@ RSpec.describe Flipper::Cloud do
30
30
  it 'sets up correct url' do
31
31
  uri = @http_client.instance_variable_get('@uri')
32
32
  expect(uri.scheme).to eq('https')
33
- expect(uri.host).to eq('www.featureflipper.com')
33
+ expect(uri.host).to eq('www.flippercloud.io')
34
34
  expect(uri.path).to eq('/adapter')
35
35
  end
36
36
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flipper-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-27 00:00:00.000000000 Z
11
+ date: 2018-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flipper
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.0
19
+ version: 0.15.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: 0.14.0
26
+ version: 0.15.0
27
27
  description: FeatureFlipper.com adapter for Flipper
28
28
  email:
29
29
  - nunemaker@gmail.com
@@ -33,6 +33,7 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - examples/cloud/basic.rb
35
35
  - examples/cloud/cached_in_memory.rb
36
+ - examples/cloud/import.rb
36
37
  - examples/cloud/local_adapter.rb
37
38
  - flipper-cloud.gemspec
38
39
  - lib/flipper-cloud.rb
@@ -61,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
62
  version: '0'
62
63
  requirements: []
63
64
  rubyforge_project:
64
- rubygems_version: 2.6.14
65
+ rubygems_version: 2.4.5.4
65
66
  signing_key:
66
67
  specification_version: 4
67
68
  summary: FeatureFlipper.com adapter for Flipper