
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
This gem provides methods to access thread local variables with a ruby trunk compatible API. It also provides an implementation of thread local variables for ruby 1.9, since ruby 1.9 made thread locals fiber local. This change in semantics can lead to surprising results when accessing thread locals from enumerators.
See http://bugs.ruby-lang.org/issues/7097
Add this line to your application's Gemfile:
gem 'thread_variables'
And then execute:
$ bundle
Or install it yourself as:
$ gem install thread_variables
Basic interface: (this is the native code interface for ruby trunk)
require "thread_variables"
Thread.current.thread_variable_set :foo, 5
Thread.current.thread_variable_get :foo
Thread.current.thread_variable? :foo
Thread.current.thread_variables
Convenience interface: (proxied access to native interface)
require "thread_variables/access"
Thread.current.locals[:foo] = 5
Thread.current.locals[:foo]
Thread.current.locals.key?(:foo)
Thread.current.locals.keys
Especially useful for the ||= pattern:
Thread.current.locals[:counter] ||= 0
Thread.current.locals[:counter] += 1
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that thread_variables demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.