Led
Redis Lua scripting using Ruby
Install / Use
/learn @noteflakes/LedREADME
Easy Lua scripting for Redis
Led makes managing Redis Lua scripts simple and easy. Features:
Installing
gem install led
How to use it
Install scripts as Ruby methods:
Led.add_script(:add, 'return tonumber(ARGV[1])+tonumber(ARGV[2])')
Led.add(12, 34) # => 46
String interpolation for lua:
Led.add_script(:interpolate, 'return "abc_#{ARGV[1]}"')
Led.interpolate('def') # => "abc_def"
Shorthand for redis calls:
Led.add_script(:set, 'SET(ARGV[1], ARGV[2])') # silly example, I know
# same as redis.call('set', ARGV[1], ARGV[2])
Reuse code by using includes:
-- helpers.lua
local function add(x, y)
return x + y
end
-- test.lua
__include 'helpers'
return add(ARGV[1], ARGV[2])
Led.script_dir = '.'
# once the script dir is set, scripts files are loaded automatically.
Led.test(1, 2) # => 3
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
