Skip to content

Commit

Permalink
Make Ruby 3.0 minimim required version
Browse files Browse the repository at this point in the history
  • Loading branch information
iMacTia committed Aug 30, 2024
1 parent a8054f4 commit 43e9bb8
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,24 @@ jobs:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3
bundler-cache: true

- name: Run rubocop
run: bundle exec rubocop --format progress
build:
needs: [linting]
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
ruby: ['3.0', '3.1', '3.2', '3.3']

steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Run tests
run: bundle exec rake
8 changes: 3 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: Set up Ruby 2.7
uses: actions/setup-ruby@v1
- uses: actions/checkout@v4
- uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.x
ruby-version: 3

- name: Publish to RubyGems
run: |
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
NewCops: enable
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0

Metrics/BlockLength:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/logging/argument_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def compiled_filter

class CompiledFilter # :nodoc:
def self.compile(filters)
return ->(args) { args.dup } if filters.empty?
return lambda(&:dup) if filters.empty?

strings = []
regexps = []
Expand Down
3 changes: 2 additions & 1 deletion lib/sidekiq/logstash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
require 'sidekiq/logstash/version'
require 'sidekiq/logging/logstash_formatter'
require 'sidekiq/logging/argument_filter'
require 'sidekiq/logstash_job_logger'

module Sidekiq
# Main level module for Sidekiq::Logstash.
Expand All @@ -22,6 +21,8 @@ def self.configure
def self.setup(_opts = {})
# Calls Sidekiq.configure_server to inject logics
Sidekiq.configure_server do |config|
require 'sidekiq/logstash_job_logger'

# Remove default, noisy error handler,
# unless LogStash.configuration.keep_default_error_handler is set to true
unless configuration.keep_default_error_handler
Expand Down
2 changes: 1 addition & 1 deletion sidekiq-logstash.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |spec|

spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 2.7.0'
spec.required_ruby_version = '>= 3.0.0'

spec.add_dependency 'logstash-event', '~> 1.2'
spec.add_dependency 'sidekiq', '~> 7.0'
Expand Down
2 changes: 1 addition & 1 deletion spec/sidekiq/logstash_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def process(worker, params = [], encrypt: false)
let(:job) { build(:job) }
let(:logstash_config) { Sidekiq::Logstash::Configuration.new }
let(:sidekiq_config) { Sidekiq::Config.new }
let(:processor) { ::Sidekiq::Processor.new(sidekiq_config.default_capsule) }
let(:processor) { Sidekiq::Processor.new(sidekiq_config.default_capsule) }
let(:log_message) { JSON.parse(buffer.string) }
let(:log_messages) { buffer.string.split("\n").map { |log| JSON.parse(log) } }
let(:mock_redis) { double(:Redis) }
Expand Down

0 comments on commit 43e9bb8

Please sign in to comment.