
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Wolverine is a simple library to allow you to manage and run redis server-side lua scripts from a rails app, or other ruby code.
Redis versions 2.6 and up allow lua scripts to be run on the server that execute atomically and very quickly.
Wolverine is a wrapper around that functionality, to package it up in a format more familiar to a Rails codebase.
redis-server -v
gem 'wolverine'
app/wolverine
:-- app/wolverine/util/mexists.lua
local exists = {}
local existence
for _, key in ipairs(KEYS) do
table.insert(exists, redis.call('exists', key))
end
return exists
Wolverine.util.mexists(['key1', 'key2', 'key3']) #=> [0, 1, 0]
Or
Wolverine.util.mexists(:keys => ['key1', 'key2', 'key3']) #=> [0, 1, 0]
Methods are available on Wolverine
paralleling the directory structure
of wolverine's script_path
.
For lua scripts with shared code, Wolverine supports ERB style templating.
If your app has lua scripts at
app/wolverine/do_something.lua
app/wolverine/do_something_else.lua
that both have shared lua code, you can factor it out into a lua "partial":
app/wolverine/shared/_common.lua
-- app/wolverine/shared/_common.lua
local function complex_redis_command(key, value)
local dict = {}
dict[key] = value
end
-- app/wolverine/do_something.lua
<%= include_partial 'shared/_common.lua' %>
complex_redis_command("foo", "bar")
return true
-- app/wolverine/do_something_else.lua
<%= include_partial 'shared/_common.lua' %>
complex_redis_command("bar", "baz")
return false
Wolverine.config.script_path
locationshared/_common.lua
). This disallows EVAL access through Wolverine.shared._common
Available configuration options:
Wolverine.config.redis
(default Redis.new
)Wolverine.config.script_path
(default Rails.root + 'app/wolverine'
)Wolverine.config.instrumentation
(default none)If you want to override one or more of these, doing so in an initializer is recommended but not required. See the full documentation for more details.
For more information on scripting redis with lua, refer to redis' excellent documentation: http://redis.io/commands/eval
FAQs
Unknown package
We found that wolverine 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
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.