diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d8c4d22b..05c2b1b50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,25 +27,9 @@ jobs: --health-retries 5 strategy: matrix: - ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3'] - rails: ['5.2', '6.0.0', '6.1.0', '7.0.0', '7.1.0'] + ruby: ['3.0', '3.1', '3.2', '3.3'] + rails: ['6.1.0', '7.0.0', '7.1.0'] exclude: - - ruby: "2.6" - rails: "7.1.0" - - ruby: "2.6" - rails: "7.0.0" - - ruby: "2.7" - rails: "7.1.0" - - ruby: "3.0" - rails: "5.2" - - ruby: "3.1" - rails: "5.2" - - ruby: "3.1" - rails: "6.0.0" - - ruby: "3.2" - rails: "5.2" - - ruby: "3.2" - rails: "6.0.0" - ruby: "3.2" rails: "6.1.0" - ruby: "3.3" diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 5f94aecc3..7b43f8465 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -16,25 +16,9 @@ jobs: --health-retries 5 strategy: matrix: - ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3'] - rails: ['5.2', '6.0.0', '6.1.0', '7.0.0', '7.1.0'] + ruby: ['3.0', '3.1', '3.2', '3.3'] + rails: ['6.1.0', '7.0.0', '7.1.0'] exclude: - - ruby: "2.6" - rails: "7.1.0" - - ruby: "2.6" - rails: "7.0.0" - - ruby: "2.7" - rails: "7.1.0" - - ruby: "3.0" - rails: "5.2" - - ruby: "3.1" - rails: "5.2" - - ruby: "3.1" - rails: "6.0.0" - - ruby: "3.2" - rails: "5.2" - - ruby: "3.2" - rails: "6.0.0" - ruby: "3.2" rails: "6.1.0" - ruby: "3.3" diff --git a/lib/flipper/adapter_builder.rb b/lib/flipper/adapter_builder.rb index 45d847883..70ef492fc 100644 --- a/lib/flipper/adapter_builder.rb +++ b/lib/flipper/adapter_builder.rb @@ -17,24 +17,12 @@ def initialize(&block) block.arity == 0 ? instance_eval(&block) : block.call(self) if block end - if RUBY_VERSION >= '3.0' - def use(klass, *args, **kwargs, &block) - @stack.push ->(adapter) { klass.new(adapter, *args, **kwargs, &block) } - end - else - def use(klass, *args, &block) - @stack.push ->(adapter) { klass.new(adapter, *args, &block) } - end + def use(klass, *args, **kwargs, &block) + @stack.push ->(adapter) { klass.new(adapter, *args, **kwargs, &block) } end - if RUBY_VERSION >= '3.0' - def store(adapter, *args, **kwargs, &block) - @store = adapter.respond_to?(:call) ? adapter : -> { adapter.new(*args, **kwargs, &block) } - end - else - def store(adapter, *args, &block) - @store = adapter.respond_to?(:call) ? adapter : -> { adapter.new(*args, &block) } - end + def store(adapter, *args, **kwargs, &block) + @store = adapter.respond_to?(:call) ? adapter : -> { adapter.new(*args, **kwargs, &block) } end def to_adapter diff --git a/lib/flipper/adapters/memoizable.rb b/lib/flipper/adapters/memoizable.rb index 8218cb1f4..3f6ae7668 100644 --- a/lib/flipper/adapters/memoizable.rb +++ b/lib/flipper/adapters/memoizable.rb @@ -143,14 +143,8 @@ def memoizing? !!@memoize end - if RUBY_VERSION >= '3.0' - def method_missing(name, *args, **kwargs, &block) - @adapter.send name, *args, **kwargs, &block - end - else - def method_missing(name, *args, &block) - @adapter.send name, *args, &block - end + def method_missing(name, *args, **kwargs, &block) + @adapter.send name, *args, **kwargs, &block end private diff --git a/lib/flipper/configuration.rb b/lib/flipper/configuration.rb index 7a9ec745a..4e50902c2 100644 --- a/lib/flipper/configuration.rb +++ b/lib/flipper/configuration.rb @@ -31,14 +31,8 @@ def adapter(&block) end # An adapter to use to augment the primary storage adapter. See `AdapterBuilder#use` - if RUBY_VERSION >= '3.0' - def use(klass, *args, **kwargs, &block) - @builder.use(klass, *args, **kwargs, &block) - end - else - def use(klass, *args, &block) - @builder.use(klass, *args, &block) - end + def use(klass, *args, **kwargs, &block) + @builder.use(klass, *args, **kwargs, &block) end # Controls the default instance for flipper. When used with a block it diff --git a/lib/flipper/types/actor.rb b/lib/flipper/types/actor.rb index 4e89b6b39..6aee41135 100644 --- a/lib/flipper/types/actor.rb +++ b/lib/flipper/types/actor.rb @@ -23,14 +23,8 @@ def respond_to?(*args) super || @actor.respond_to?(*args) end - if RUBY_VERSION >= '3.0' - def method_missing(name, *args, **kwargs, &block) - @actor.send name, *args, **kwargs, &block - end - else - def method_missing(name, *args, &block) - @actor.send name, *args, &block - end + def method_missing(name, *args, **kwargs, &block) + @actor.send name, *args, **kwargs, &block end end end diff --git a/lib/flipper/version.rb b/lib/flipper/version.rb index a31fb4dfc..5b9777564 100644 --- a/lib/flipper/version.rb +++ b/lib/flipper/version.rb @@ -1,7 +1,7 @@ module Flipper VERSION = '1.1.2'.freeze - REQUIRED_RUBY_VERSION = '2.6'.freeze + REQUIRED_RUBY_VERSION = '3.0'.freeze NEXT_REQUIRED_RUBY_VERSION = '3.0'.freeze REQUIRED_RAILS_VERSION = '5.2'.freeze diff --git a/spec/flipper/cloud_spec.rb b/spec/flipper/cloud_spec.rb index 0cdf40e77..29c9c7aeb 100644 --- a/spec/flipper/cloud_spec.rb +++ b/spec/flipper/cloud_spec.rb @@ -94,12 +94,10 @@ described_class.new(token: 'asdf', open_timeout: 1) end - if RUBY_VERSION >= '2.6.0' - it 'can set write_timeout' do - expect(Flipper::Adapters::Http::Client).to receive(:new) - .with(hash_including(open_timeout: 1)).at_least(:once) - described_class.new(token: 'asdf', open_timeout: 1) - end + it 'can set write_timeout' do + expect(Flipper::Adapters::Http::Client).to receive(:new) + .with(hash_including(open_timeout: 1)).at_least(:once) + described_class.new(token: 'asdf', open_timeout: 1) end it 'can import' do