From ac2578ebac486c0f5d21d014a4f3edd389eada9c Mon Sep 17 00:00:00 2001 From: shepamat000 Date: Tue, 17 Jun 2025 15:41:01 -0500 Subject: [PATCH 1/8] Initial Commit --- Gemfile | 2 +- conf/redis-docker.conf | 40 +++++++++++++++++++++++++++++++++++++ lib/qless/lua_script_fix.rb | 23 +++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 conf/redis-docker.conf create mode 100644 lib/qless/lua_script_fix.rb diff --git a/Gemfile b/Gemfile index e8dd6511..248fea6a 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "http://rubygems.org" gemspec group :extras do - gem 'debugger', :platform => :mri_19 + # gem 'debugger', :platform => :mri_19 end gem 'thin' # needed by qless-web binary diff --git a/conf/redis-docker.conf b/conf/redis-docker.conf new file mode 100644 index 00000000..423e59c6 --- /dev/null +++ b/conf/redis-docker.conf @@ -0,0 +1,40 @@ +# Redis configuration file for Docker + +# By default Redis does not run as a daemon. Use 'no' for Docker containers. +daemonize no + +# Accept connections on the specified port, default is 6379. +port 6379 + +# Set server verbosity +loglevel notice + +# Specify the log file name. Using stdout for Docker +logfile "" + +# Set the number of databases. +databases 16 + +################################ SNAPSHOTTING ################################# +save 900 1 +save 300 10 +save 60 10000 + +# Stop accepting writes if saving fails +stop-writes-on-bgsave-error yes + +# Compress string objects using LZF when dump .rdb databases? +rdbcompression yes + +# CRC64 checksum at the end of the file +rdbchecksum yes + +# The filename where to dump the DB +dbfilename dump.rdb + +# The working directory - using /data which is a standard location in Redis Docker image +dir /data + +# Redis Lua scripts configuration +lua-time-limit 5000 + diff --git a/lib/qless/lua_script_fix.rb b/lib/qless/lua_script_fix.rb new file mode 100644 index 00000000..1c5aff41 --- /dev/null +++ b/lib/qless/lua_script_fix.rb @@ -0,0 +1,23 @@ +require_relative './lua_script' + +# Monkey patch to fix the Lua script argument handling issue +module Qless + class LuaScript + # Redefine the private _call method to ensure all arguments are properly converted to strings + private + + if USING_LEGACY_REDIS_VERSION + def _call(*argv) + # Convert all arguments to strings to fix the "Lua redis() command arguments must be strings or integers" error + string_args = argv.map { |arg| arg.to_s } + @redis.evalsha(@sha, 0, *string_args) + end + else + def _call(*argv) + # Convert all arguments to strings to fix the "Lua redis() command arguments must be strings or integers" error + string_args = argv.map { |arg| arg.to_s } + @redis.evalsha(@sha, keys: [], argv: string_args) + end + end + end +end From c9449d58144c6f6b960b7d45fc03a0d4edd0a99a Mon Sep 17 00:00:00 2001 From: shepamat000 Date: Tue, 17 Jun 2025 15:41:41 -0500 Subject: [PATCH 2/8] Initial Commit --- conf/redis-docker.conf | 40 ------------------------------------- lib/qless/lua_script_fix.rb | 23 --------------------- 2 files changed, 63 deletions(-) delete mode 100644 conf/redis-docker.conf delete mode 100644 lib/qless/lua_script_fix.rb diff --git a/conf/redis-docker.conf b/conf/redis-docker.conf deleted file mode 100644 index 423e59c6..00000000 --- a/conf/redis-docker.conf +++ /dev/null @@ -1,40 +0,0 @@ -# Redis configuration file for Docker - -# By default Redis does not run as a daemon. Use 'no' for Docker containers. -daemonize no - -# Accept connections on the specified port, default is 6379. -port 6379 - -# Set server verbosity -loglevel notice - -# Specify the log file name. Using stdout for Docker -logfile "" - -# Set the number of databases. -databases 16 - -################################ SNAPSHOTTING ################################# -save 900 1 -save 300 10 -save 60 10000 - -# Stop accepting writes if saving fails -stop-writes-on-bgsave-error yes - -# Compress string objects using LZF when dump .rdb databases? -rdbcompression yes - -# CRC64 checksum at the end of the file -rdbchecksum yes - -# The filename where to dump the DB -dbfilename dump.rdb - -# The working directory - using /data which is a standard location in Redis Docker image -dir /data - -# Redis Lua scripts configuration -lua-time-limit 5000 - diff --git a/lib/qless/lua_script_fix.rb b/lib/qless/lua_script_fix.rb deleted file mode 100644 index 1c5aff41..00000000 --- a/lib/qless/lua_script_fix.rb +++ /dev/null @@ -1,23 +0,0 @@ -require_relative './lua_script' - -# Monkey patch to fix the Lua script argument handling issue -module Qless - class LuaScript - # Redefine the private _call method to ensure all arguments are properly converted to strings - private - - if USING_LEGACY_REDIS_VERSION - def _call(*argv) - # Convert all arguments to strings to fix the "Lua redis() command arguments must be strings or integers" error - string_args = argv.map { |arg| arg.to_s } - @redis.evalsha(@sha, 0, *string_args) - end - else - def _call(*argv) - # Convert all arguments to strings to fix the "Lua redis() command arguments must be strings or integers" error - string_args = argv.map { |arg| arg.to_s } - @redis.evalsha(@sha, keys: [], argv: string_args) - end - end - end -end From 12e7cc23e30d567156e10133209a3b62494be2cc Mon Sep 17 00:00:00 2001 From: shepamat000 Date: Tue, 17 Jun 2025 15:44:09 -0500 Subject: [PATCH 3/8] Gemfile change --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 248fea6a..e8dd6511 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "http://rubygems.org" gemspec group :extras do - # gem 'debugger', :platform => :mri_19 + gem 'debugger', :platform => :mri_19 end gem 'thin' # needed by qless-web binary From 6d158e8a7a3ae3bd2b366072b9cdf52325719fa3 Mon Sep 17 00:00:00 2001 From: shepamat000 Date: Tue, 17 Jun 2025 17:40:03 -0500 Subject: [PATCH 4/8] Updated Sinatra to 2.0.0, Rack to 2.0.9.1 --- Gemfile | 2 +- Gemfile.lock | 20 +++++++++++--------- conf/redis-docker.conf | 40 ++++++++++++++++++++++++++++++++++++++++ qless.gemspec | 2 +- 4 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 conf/redis-docker.conf diff --git a/Gemfile b/Gemfile index e8dd6511..248fea6a 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "http://rubygems.org" gemspec group :extras do - gem 'debugger', :platform => :mri_19 + # gem 'debugger', :platform => :mri_19 end gem 'thin' # needed by qless-web binary diff --git a/Gemfile.lock b/Gemfile.lock index 81a6fcbe..eb9e3243 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,7 +38,7 @@ GEM debugger-linecache (1.2.0) debugger-ruby_core_source (1.2.3) diff-lcs (1.2.4) - eventmachine (1.0.3) + eventmachine (1.2.0) faraday (0.8.8) multipart-post (~> 1.2.0) faye-websocket (0.4.7) @@ -58,6 +58,7 @@ GEM mini_portile (0.5.1) multi_json (1.8.0) multipart-post (1.2.0) + mustermann (1.0.0) nokogiri (1.6.0) mini_portile (~> 0.5.0) parallel (1.4.1) @@ -81,8 +82,8 @@ GEM pry-stack_explorer (0.4.9.2) binding_of_caller (>= 0.7) pry (>= 0.9.11) - rack (1.5.2) - rack-protection (1.5.0) + rack (2.0.9.1) + rack-protection (2.0.0) rack rack-test (0.6.2) rack (>= 1.0) @@ -118,16 +119,17 @@ GEM multi_json (~> 1.0) simplecov-html (~> 0.7.1) simplecov-html (0.7.1) - sinatra (1.3.6) - rack (~> 1.4) - rack-protection (~> 1.3) - tilt (~> 1.3, >= 1.3.3) + sinatra (2.0.0) + mustermann (~> 1.0) + rack (~> 2.0) + rack-protection (2.0.0) + tilt (~> 2.0) slop (3.4.6) thin (1.5.1) daemons (>= 1.0.9) eventmachine (>= 0.12.6) rack (>= 1.0.0) - tilt (1.4.1) + tilt (2.0.0) timecop (0.7.1) uuidtools (2.1.4) vegas (0.1.11) @@ -159,7 +161,7 @@ DEPENDENCIES rusage (~> 0.2.0) sentry-raven (~> 0.4) simplecov (~> 0.7.1) - sinatra (~> 1.3.2) + sinatra (~> 2.0.0) thin timecop (~> 0.7.1) vegas (~> 0.1.11) diff --git a/conf/redis-docker.conf b/conf/redis-docker.conf new file mode 100644 index 00000000..423e59c6 --- /dev/null +++ b/conf/redis-docker.conf @@ -0,0 +1,40 @@ +# Redis configuration file for Docker + +# By default Redis does not run as a daemon. Use 'no' for Docker containers. +daemonize no + +# Accept connections on the specified port, default is 6379. +port 6379 + +# Set server verbosity +loglevel notice + +# Specify the log file name. Using stdout for Docker +logfile "" + +# Set the number of databases. +databases 16 + +################################ SNAPSHOTTING ################################# +save 900 1 +save 300 10 +save 60 10000 + +# Stop accepting writes if saving fails +stop-writes-on-bgsave-error yes + +# Compress string objects using LZF when dump .rdb databases? +rdbcompression yes + +# CRC64 checksum at the end of the file +rdbchecksum yes + +# The filename where to dump the DB +dbfilename dump.rdb + +# The working directory - using /data which is a standard location in Redis Docker image +dir /data + +# Redis Lua scripts configuration +lua-time-limit 5000 + diff --git a/qless.gemspec b/qless.gemspec index c423b2b6..7f3e0f92 100644 --- a/qless.gemspec +++ b/qless.gemspec @@ -37,7 +37,7 @@ language-specific extension will also remain up to date. s.add_dependency 'redis', '>= 2.2' - s.add_development_dependency 'sinatra' , '~> 1.3.2' + s.add_development_dependency 'sinatra' , '~> 2.0.0' s.add_development_dependency 'vegas' , '~> 0.1.11' s.add_development_dependency 'rspec' , '~> 2.12' s.add_development_dependency 'rspec-fire' , '~> 1.1' From af413c367455fa6f1663aacb76083cea568376b5 Mon Sep 17 00:00:00 2001 From: shepamat000 Date: Tue, 17 Jun 2025 17:40:20 -0500 Subject: [PATCH 5/8] Updated Sinatra to 2.0.0, Rack to 2.0.9.1 --- conf/redis-docker.conf | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 conf/redis-docker.conf diff --git a/conf/redis-docker.conf b/conf/redis-docker.conf deleted file mode 100644 index 423e59c6..00000000 --- a/conf/redis-docker.conf +++ /dev/null @@ -1,40 +0,0 @@ -# Redis configuration file for Docker - -# By default Redis does not run as a daemon. Use 'no' for Docker containers. -daemonize no - -# Accept connections on the specified port, default is 6379. -port 6379 - -# Set server verbosity -loglevel notice - -# Specify the log file name. Using stdout for Docker -logfile "" - -# Set the number of databases. -databases 16 - -################################ SNAPSHOTTING ################################# -save 900 1 -save 300 10 -save 60 10000 - -# Stop accepting writes if saving fails -stop-writes-on-bgsave-error yes - -# Compress string objects using LZF when dump .rdb databases? -rdbcompression yes - -# CRC64 checksum at the end of the file -rdbchecksum yes - -# The filename where to dump the DB -dbfilename dump.rdb - -# The working directory - using /data which is a standard location in Redis Docker image -dir /data - -# Redis Lua scripts configuration -lua-time-limit 5000 - From c6b735ba89d87c1695659f8cb69daf3f4e3d907c Mon Sep 17 00:00:00 2001 From: shepamat000 Date: Wed, 18 Jun 2025 14:34:12 -0500 Subject: [PATCH 6/8] Additional fixes for Ruby 2.2 --- Gemfile | 7 ++++--- Gemfile.lock | 13 ++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 248fea6a..1262ede7 100644 --- a/Gemfile +++ b/Gemfile @@ -8,11 +8,12 @@ group :extras do end gem 'thin' # needed by qless-web binary +gem 'erubis' group :development do - gem 'byebug', :platforms => [:ruby_20, :ruby_21] + gem 'byebug', :platforms => [:ruby_20, :ruby_21, :ruby_22] gem 'pry' - gem 'pry-byebug', :platforms => [:ruby_20, :ruby_21] + gem 'pry-byebug', :platforms => [:ruby_20, :ruby_21, :ruby_22] gem 'pry-stack_explorer' - gem 'cane', :platforms => [:ruby_20, :ruby_21] + gem 'cane', :platforms => [:ruby_20, :ruby_21, :ruby_22] end diff --git a/Gemfile.lock b/Gemfile.lock index eb9e3243..22fa1bd6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,13 +31,9 @@ GEM columnize (0.3.6) daemons (1.1.9) debug_inspector (0.0.2) - debugger (1.6.2) - columnize (>= 0.3.1) - debugger-linecache (~> 1.2.0) - debugger-ruby_core_source (~> 1.2.3) debugger-linecache (1.2.0) - debugger-ruby_core_source (1.2.3) diff-lcs (1.2.4) + erubis (2.7.0) eventmachine (1.2.0) faraday (0.8.8) multipart-post (~> 1.2.0) @@ -122,7 +118,7 @@ GEM sinatra (2.0.0) mustermann (~> 1.0) rack (~> 2.0) - rack-protection (2.0.0) + rack-protection (= 2.0.0) tilt (~> 2.0) slop (3.4.6) thin (1.5.1) @@ -145,7 +141,7 @@ DEPENDENCIES byebug cane capybara (~> 1.1.2) - debugger + erubis faye-websocket (~> 0.4.0) launchy (~> 2.1.0) metriks (~> 0.9) @@ -165,3 +161,6 @@ DEPENDENCIES thin timecop (~> 0.7.1) vegas (~> 0.1.11) + +BUNDLED WITH + 1.17.3 From 9a48b20fb467c9213e1b9982be18d30cde6d61aa Mon Sep 17 00:00:00 2001 From: shepamat000 Date: Wed, 18 Jun 2025 15:02:34 -0500 Subject: [PATCH 7/8] Gemfile fix --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 1262ede7..7090d3b5 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source "http://rubygems.org" gemspec group :extras do - # gem 'debugger', :platform => :mri_19 + gem 'debugger', :platform => :mri_19 end gem 'thin' # needed by qless-web binary From 898315bb12b538de23224906ff1e4862cd306b50 Mon Sep 17 00:00:00 2001 From: shepamat000 Date: Wed, 18 Jun 2025 15:05:05 -0500 Subject: [PATCH 8/8] Updated Ruby Version --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index df28eb54..7e541aec 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -1.9.3-p429 +2.2.2 \ No newline at end of file