Skip to content

Commit

Permalink
Fix broken CI (#390)
Browse files Browse the repository at this point in the history
* Rails edge requires Ruby version >= 3.1

Ref: rails/rails#50491

* Fix Rubocop offences

* Add `mutex_m`a and `base64` to dev dependencies

`mutex_m` and `base64` are bundled gem since Ruby 3.4.

Rails uses `mutex_m` and `base64` and newer versions add those as
dependencies.
Ref: rails/rails#48907

But, old Rails aren't supported. So we need to add those gems
to run CI.
  • Loading branch information
y-yagi committed May 30, 2024
1 parent 2839d2c commit d5f6b70
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ jobs:
gemfile: gemfiles/rails_7.1.gemfile
- ruby: jruby-9.2
gemfile: gemfiles/rails_7.0.gemfile
# NOTE: Rails edge requires Ruby version >= 3.1
- ruby: "2.7"
gemfile: gemfiles/rails_edge.gemfile
- ruby: "3.0"
gemfile: gemfiles/rails_edge.gemfile


env:
Expand Down
2 changes: 1 addition & 1 deletion lib/lograge/formatters/graylog2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def call(data)
end

def underscore_prefix(key)
"_#{key}".to_sym
:"_#{key}"
end

def short_message(data)
Expand Down
2 changes: 1 addition & 1 deletion lib/lograge/formatters/key_value_deep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Lograge
module Formatters
class KeyValueDeep < KeyValue
def call(data)
super flatten_keys(data)
super(flatten_keys(data))
end

protected
Expand Down
2 changes: 1 addition & 1 deletion lib/lograge/formatters/l2met.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def additional_fields(data)
def format(key, value)
key = "measure#page.#{key}" if value.is_a?(Float)

super(key, value)
super
end

def modify_payload(data)
Expand Down
2 changes: 1 addition & 1 deletion lib/lograge/log_subscribers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_error_status_code(exception_class_name)
end

def extract_allocations(event)
if (allocations = (event.respond_to?(:allocations) && event.allocations))
if (allocations = event.respond_to?(:allocations) && event.allocations)
{ allocations: allocations }
else
{}
Expand Down
4 changes: 3 additions & 1 deletion lograge.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ Gem::Specification.new do |s|

s.files = `git ls-files lib LICENSE.txt`.split("\n")

s.add_development_dependency 'base64'
s.add_development_dependency 'mutex_m'
s.add_development_dependency 'rspec', '~> 3.1'
s.add_development_dependency 'rubocop', '~> 1.23'
s.add_development_dependency 'simplecov', '~> 0.21'

s.add_runtime_dependency 'actionpack', '>= 4'
s.add_runtime_dependency 'activesupport', '>= 4'
s.add_runtime_dependency 'railties', '>= 4'
s.add_runtime_dependency 'railties', '>= 4'
s.add_runtime_dependency 'request_store', '~> 1.0'
end

0 comments on commit d5f6b70

Please sign in to comment.