dry-rb / dry-effects

Algebraic effects in Ruby
https://dry-rb.org/gems/dry-effects/
MIT License
112 stars 20 forks source link

Extension to patch AS::TaggedLogging for compatibility #76

Closed leehambley closed 4 years ago

leehambley commented 4 years ago

ActiveSupport::TaggedLogging uses Thread.current[]= to track log tags. This Thread.current[]= is however Fiber local variable (since Ruby 2.0)

Compare:

The patch uses #thread_variable_set and #thread_variable_get which are part of Ruby itself since 2.0. ActiveSupport contained shims for this in the 4.x series, they were dropped in the 5.x series when Rails adopted a minimum RUBY_VERSION of 2.2, and thus was guaranteed access to those native implementations of thread_varaible_{set,get}

dry-bot commented 4 years ago

Codacy Here is an overview of what got changed by this pull request:


Complexity increasing per file
==============================
- spec/extensions/activesupport_taggedlogging_formatter.rb  2

See the complete overview on Codacy

flash-gordon commented 4 years ago

Thanks, I'll make a few tweaks and push a release shortly after.