Skip to content

Commit

Permalink
Merge pull request #199 from bigcommerce/ruby-33
Browse files Browse the repository at this point in the history
Add ruby 3.3 support, drop Ruby 2.x support
  • Loading branch information
splittingred authored Feb 5, 2024
2 parents 73c0152 + 327314c commit 4d1b67b
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 28 deletions.
42 changes: 21 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ gem_cache_key: &gem_cache_key
gem_cache_key: "gem-cache-v2"

executors:
ruby_2_7:
<<: *ruby_env
parameters:
ruby-version:
type: string
default: "2.7"
ruby_3_0:
<<: *ruby_env
parameters:
Expand All @@ -43,6 +37,12 @@ executors:
ruby-version:
type: string
default: "3.2"
ruby_3_3:
<<: *ruby_env
parameters:
ruby-version:
type: string
default: "3.3"

commands:
pre-setup:
Expand Down Expand Up @@ -178,21 +178,6 @@ jobs:

workflows:
version: 2
ruby_2_7:
jobs:
- bundle-audit:
name: "ruby-2_7-bundle_audit"
e: "ruby_2_7"
- rubocop:
name: "ruby-2_7-rubocop"
e: "ruby_2_7"
- rspec-unit:
name: "ruby-2_7-rspec"
e: "ruby_2_7"
code-climate: false
- e2e:
name: "ruby-2_7-e2e"
e: "ruby_2_7"
ruby_3_0:
jobs:
- bundle-audit:
Expand Down Expand Up @@ -238,3 +223,18 @@ workflows:
- e2e:
name: "ruby-3_2-e2e"
e: "ruby_3_2"
ruby_3_3:
jobs:
- bundle-audit:
name: "ruby-3_3-bundle_audit"
e: "ruby_3_3"
- rubocop:
name: "ruby-3_3-rubocop"
e: "ruby_3_3"
- rspec-unit:
name: "ruby-3_3-rspec"
e: "ruby_3_3"
code-climate: false
- e2e:
name: "ruby-3_3-e2e"
e: "ruby_3_3"
5 changes: 4 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
####################################################################################################

AllCops:
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0
SuggestExtensions: false
NewCops: enable
Exclude:
Expand Down Expand Up @@ -70,6 +70,9 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Max: 12

Style/ArgumentsForwarding:
Enabled: false

####################################################################################################
# Naming Configurations
####################################################################################################
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ Changelog for the gruf gem. This includes internal history before the gem was ma

### Pending release

* [#197] Add support for Ruby 3.3
* Drop support for Ruby 2.x

### 2.18.0

* Add `GRUF_USE_DEFAULT_INTERCEPTORS` ENV to dynamically enable/disable default interceptors
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ up fast and efficiently at scale. Some of its features include:
still preserving gRPC BadStatus codes
* Server and client execution timings in responses

gruf currently has active support for gRPC 1.10.x+. gruf is compatible and tested with Ruby 2.7-3.2.
gruf currently has active support for gRPC 1.10.x+. gruf is compatible and tested with Ruby 3.0-3.3.
gruf is also not [Rails](https://github.com/rails/rails)-specific, and can be used in any Ruby framework
(such as [Grape](https://github.com/ruby-grape/grape) or [dry-rb](https://dry-rb.org/), for instance).

Expand Down
2 changes: 1 addition & 1 deletion gruf.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
spec.executables << 'gruf'
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 2.7', '< 3.3'
spec.required_ruby_version = '>= 3.0', '< 3.4'

spec.metadata = {
'bug_tracker_uri' => 'https://github.com/bigcommerce/gruf/issues',
Expand Down
4 changes: 2 additions & 2 deletions lib/gruf/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ module Configuration
}.freeze
}.freeze

attr_accessor(* VALID_CONFIG_KEYS.keys)
attr_accessor(*VALID_CONFIG_KEYS.keys)

##
# Whenever this is extended into a class, setup the defaults
Expand Down Expand Up @@ -164,7 +164,7 @@ def options
#
def reset
VALID_CONFIG_KEYS.each do |k, v|
send("#{k}=", v)
send(:"#{k}=", v)
end
self.server_binding_url = "#{::ENV.fetch('GRPC_SERVER_HOST',
'0.0.0.0')}:#{::ENV.fetch('GRPC_SERVER_PORT', 9_001)}"
Expand Down
2 changes: 1 addition & 1 deletion lib/gruf/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def initialize(args = {})
@field_errors = []
@metadata = {}
args.each do |k, v|
send("#{k}=", v) if respond_to?(k)
send(:"#{k}=", v) if respond_to?(k)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
require 'ffaker'
require 'pry'

Dir["#{File.join(File.dirname(__FILE__), 'support')}/**/*.rb"].sort.each { |f| require f }
Dir["#{File.join(File.dirname(__FILE__), 'support')}/**/*.rb"].each { |f| require f }

RSpec.configure do |config|
config.mock_with :rspec do |mocks|
Expand Down

0 comments on commit 4d1b67b

Please sign in to comment.