From 9146883927e59d22faae07ac53c470e29c29c452 Mon Sep 17 00:00:00 2001 From: Michael Lang Date: Sat, 16 May 2026 13:57:48 -0400 Subject: [PATCH 1/3] Bump to v0.4.0 with Ruby 4.0 support Updates required Ruby to >= 4.0, targets Ruby 4.0 in CI, updates RuboCop target, adds csv as explicit dependency, and fixes experimental regex for Ruby 4 method name format. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci.yml | 5 +- .rubocop.yml | 2 +- .ruby-version | 2 +- Gemfile.lock | 173 ++++++++++++++++++++++---------------- lib/quant/experimental.rb | 2 +- lib/quant/version.rb | 2 +- quantitative.gemspec | 5 +- 7 files changed, 109 insertions(+), 82 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cca3e6d..4593f97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,9 @@ jobs: ruby: # - '3.0' # - '3.1' - - '3.2' - - '3.3' + # - '3.2' + # - '3.3' + - '4.0' name: RSpec tests ruby ${{ matrix.ruby }} diff --git a/.rubocop.yml b/.rubocop.yml index 87a3538..6687783 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_gem: relaxed-rubocop: .rubocop.yml AllCops: - TargetRubyVersion: 3.2 + TargetRubyVersion: 4.0 Exclude: - 'spec/performance/*.rb' diff --git a/.ruby-version b/.ruby-version index 15a2799..c5106e6 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.0 +4.0.4 diff --git a/Gemfile.lock b/Gemfile.lock index ecee9fa..c8e9582 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,27 +1,35 @@ PATH remote: . specs: - quantitative (0.3.3) + quantitative (0.4.0) + csv oj (~> 3.10) zeitwerk (~> 2.6) GEM remote: https://rubygems.org/ specs: - ast (2.4.2) - benchmark-ips (2.13.0) - bigdecimal (3.1.6) + ast (2.4.3) + base64 (0.3.0) + benchmark-ips (2.14.0) + bigdecimal (4.1.2) coderay (1.1.3) - debug (1.8.0) - irb (>= 1.5.0) - reline (>= 0.3.1) - diff-lcs (1.5.0) - docile (1.4.0) - ffi (1.16.3) - formatador (1.1.0) - guard (2.18.1) + csv (3.3.5) + date (3.5.1) + debug (1.11.1) + irb (~> 1.10) + reline (>= 0.3.8) + diff-lcs (1.6.2) + docile (1.4.1) + erb (6.0.4) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-linux-gnu) + formatador (1.2.3) + reline + guard (2.20.1) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) + logger (~> 1.6) lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) @@ -33,104 +41,121 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - io-console (0.6.0) - irb (1.9.1) - rdoc - reline (>= 0.3.8) - json (2.7.1) - language_server-protocol (3.17.0.3) - listen (3.8.0) + io-console (0.8.2) + irb (1.18.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.19.5) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + listen (3.10.0) + logger rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - lumberjack (1.2.9) - method_source (1.0.0) + logger (1.7.0) + lumberjack (1.4.2) + method_source (1.1.0) nenv (0.3.0) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - oj (3.16.3) + oj (3.17.0) bigdecimal (>= 3.0) - parallel (1.24.0) - parser (3.3.0.4) + ostruct (>= 0.2) + ostruct (0.6.3) + parallel (2.1.0) + parser (3.3.11.1) ast (~> 2.4.1) racc - pry (0.14.2) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.9.0) + pry (0.16.0) coderay (~> 1.1) method_source (~> 1.0) - psych (5.1.2) + reline (>= 0.6.0) + psych (5.3.1) + date stringio - racc (1.7.3) + racc (1.8.1) rainbow (3.1.1) - rake (13.1.0) + rake (13.4.2) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.6.2) + rdoc (7.2.0) + erb psych (>= 4.0.0) - regexp_parser (2.9.0) + tsort + regexp_parser (2.12.0) relaxed-rubocop (2.5) - reline (0.4.1) + reline (0.6.3) io-console (~> 0.5) - rexml (3.2.6) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rexml (3.4.4) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-github (2.4.0) + rspec-support (~> 3.13.0) + rspec-github (3.0.0) rspec-core (~> 3.0) - rspec-mocks (3.12.6) + rspec-mocks (3.13.8) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) - rubocop (1.60.1) + rspec-support (~> 3.13.0) + rspec-support (3.13.7) + rubocop (1.86.1) json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (>= 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.20.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.25.1) - rubocop (~> 1.41) - rubocop-rspec (2.26.1) - rubocop (~> 1.40) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) - ruby-prof (1.7.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.1) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-rspec (3.9.0) + lint_roller (~> 1.1) + rubocop (~> 1.81) + ruby-prof (2.0.4) + base64 + ostruct ruby-progressbar (1.13.0) shellany (0.0.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-cobertura (2.1.0) + simplecov-cobertura (3.1.0) rexml simplecov (~> 0.19) - simplecov-html (0.12.3) + simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) - stackprof (0.2.26) - stringio (3.1.0) - test-prof (1.3.2) - thor (1.3.0) - unicode-display_width (2.5.0) - vernier (0.5.1) - yard (0.9.34) - zeitwerk (2.6.15) + stackprof (0.2.28) + stringio (3.2.0) + test-prof (1.6.1) + thor (1.5.0) + tsort (0.2.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + vernier (1.10.1) + yard (0.9.43) + zeitwerk (2.7.5) PLATFORMS arm64-darwin-22 + arm64-darwin-25 x86_64-linux DEPENDENCIES @@ -153,4 +178,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.3.13 + 4.0.10 diff --git a/lib/quant/experimental.rb b/lib/quant/experimental.rb index fba23ed..b399ed1 100644 --- a/lib/quant/experimental.rb +++ b/lib/quant/experimental.rb @@ -22,7 +22,7 @@ def experimental(message) Experimental.tracker[caller.first] = message - calling_method = caller.first.scan(/`([^']*)/)[0][0] + calling_method = caller.first[/in ["`'](.+?)[`']/, 1] || "unknown" full_message = "EXPERIMENTAL: #{calling_method.inspect}: #{message}\nsource location: #{caller.first}" puts full_message end diff --git a/lib/quant/version.rb b/lib/quant/version.rb index 82adaba..547a7e5 100644 --- a/lib/quant/version.rb +++ b/lib/quant/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Quant - VERSION = "0.3.3" + VERSION = "0.4.0" end diff --git a/quantitative.gemspec b/quantitative.gemspec index 3ebc7ee..1e26efb 100644 --- a/quantitative.gemspec +++ b/quantitative.gemspec @@ -8,11 +8,11 @@ Gem::Specification.new do |spec| spec.authors = ["Michael Lang"] spec.email = ["mwlang@cybrains.net"] - spec.summary = "Quantitative and statistical tools written for Ruby 3.2+ for trading and finance." + spec.summary = "Quantitative and statistical tools written for Ruby 4.0+ for trading and finance." spec.description = spec.summary spec.homepage = "https://github.com/mwlang/quantitative" spec.license = "MIT" - spec.required_ruby_version = ">= 3.2" + spec.required_ruby_version = ">= 4.0" spec.metadata["allowed_push_host"] = "https://rubygems.org" @@ -32,6 +32,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] # Uncomment to register a new dependency of your gem + spec.add_dependency "csv" spec.add_dependency "oj", "~> 3.10" spec.add_dependency "zeitwerk", "~> 2.6" From 3fb3d060d4493c17035110b2d42c1fa76e84d1eb Mon Sep 17 00:00:00 2001 From: Michael Lang Date: Sat, 16 May 2026 14:52:17 -0400 Subject: [PATCH 2/3] Add Ruby 3.2, 3.3, 3.4 support alongside 4.0 Restores multi-version CI matrix (3.2, 3.3, 3.4, 4.0), relaxes required_ruby_version to >= 3.2, and sets RuboCop TargetRubyVersion to 3.2 to match the minimum supported version. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci.yml | 5 +++-- .rubocop.yml | 2 +- quantitative.gemspec | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4593f97..7387402 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,9 @@ jobs: ruby: # - '3.0' # - '3.1' - # - '3.2' - # - '3.3' + - '3.2' + - '3.3' + - '3.4' - '4.0' diff --git a/.rubocop.yml b/.rubocop.yml index 6687783..87a3538 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_gem: relaxed-rubocop: .rubocop.yml AllCops: - TargetRubyVersion: 4.0 + TargetRubyVersion: 3.2 Exclude: - 'spec/performance/*.rb' diff --git a/quantitative.gemspec b/quantitative.gemspec index 1e26efb..56c1e07 100644 --- a/quantitative.gemspec +++ b/quantitative.gemspec @@ -8,11 +8,11 @@ Gem::Specification.new do |spec| spec.authors = ["Michael Lang"] spec.email = ["mwlang@cybrains.net"] - spec.summary = "Quantitative and statistical tools written for Ruby 4.0+ for trading and finance." + spec.summary = "Quantitative and statistical tools written for Ruby for trading and finance." spec.description = spec.summary spec.homepage = "https://github.com/mwlang/quantitative" spec.license = "MIT" - spec.required_ruby_version = ">= 4.0" + spec.required_ruby_version = ">= 3.2" spec.metadata["allowed_push_host"] = "https://rubygems.org" From 2373e48e41af4407965534887545d52613c84d7d Mon Sep 17 00:00:00 2001 From: Michael Lang Date: Sat, 16 May 2026 14:54:02 -0400 Subject: [PATCH 3/3] Drop Ruby 3.2 support; minimum is now 3.3 parallel gem (rubocop transitive dep) requires Ruby >= 3.3. CI matrix is now 3.3, 3.4, and 4.0. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci.yml | 1 - .rubocop.yml | 2 +- quantitative.gemspec | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7387402..7fba991 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,6 @@ jobs: ruby: # - '3.0' # - '3.1' - - '3.2' - '3.3' - '3.4' - '4.0' diff --git a/.rubocop.yml b/.rubocop.yml index 87a3538..c314ee9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ inherit_gem: relaxed-rubocop: .rubocop.yml AllCops: - TargetRubyVersion: 3.2 + TargetRubyVersion: 3.3 Exclude: - 'spec/performance/*.rb' diff --git a/quantitative.gemspec b/quantitative.gemspec index 56c1e07..5107230 100644 --- a/quantitative.gemspec +++ b/quantitative.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.description = spec.summary spec.homepage = "https://github.com/mwlang/quantitative" spec.license = "MIT" - spec.required_ruby_version = ">= 3.2" + spec.required_ruby_version = ">= 3.3" spec.metadata["allowed_push_host"] = "https://rubygems.org"