diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 9541344..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Ruby - -on: - push: - branches: - - main - - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - name: Ruby ${{ matrix.ruby }} - strategy: - matrix: - ruby: - - '3.2.0' - - steps: - - uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: Run the default task - run: bundle exec rake diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 50b0d1d..395d0d5 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -1,38 +1,35 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake -# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby - name: Ruby on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] permissions: contents: read jobs: test: - runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - ruby-version: ['2.7', '3.0'] + ruby-version: + - "3.2" + - "3.3" + - "3.4" + + name: Ruby ${{ matrix.ruby-version }} steps: - - uses: actions/checkout@v3 - - name: Set up Ruby - # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, - # change this to (see https://github.com/ruby/setup-ruby#versioning): - # uses: ruby/setup-ruby@v1 - uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 - with: - ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Run tests - run: bundle exec rake + - uses: actions/checkout@v4 + + - name: Set up Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: Run tests + run: bundle exec rake diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..f989260 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.4.4 diff --git a/Gemfile.lock b/Gemfile.lock index 1b5fb49..25a54b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,6 +2,7 @@ PATH remote: . specs: kickplan-sdk (0.1.0) + bigdecimal concurrent-ruby (>= 1.0) dry-configurable (>= 1.0) dry-struct (>= 1.0) @@ -13,6 +14,8 @@ GEM specs: addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) + base64 (0.3.0) + bigdecimal (3.1.8) coderay (1.1.3) concurrent-ruby (1.0.3) crack (0.4.5) @@ -79,6 +82,7 @@ PLATFORMS ruby DEPENDENCIES + base64 bundler (~> 2.0) dotenv (~> 2.0) kickplan-sdk! diff --git a/kickplan-sdk-0.1.0.gem b/kickplan-sdk-0.1.0.gem index ea4aff0..bf34c7c 100644 Binary files a/kickplan-sdk-0.1.0.gem and b/kickplan-sdk-0.1.0.gem differ diff --git a/kickplan.gemspec b/kickplan.gemspec index 6e6a7fe..8c993d1 100644 --- a/kickplan.gemspec +++ b/kickplan.gemspec @@ -25,7 +25,9 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "dry-struct", ">= 1.0" spec.add_runtime_dependency "dry-types", ">= 1.7" spec.add_runtime_dependency "faraday", ">= 1.0" + spec.add_runtime_dependency "bigdecimal" # Required for Ruby 3.4+ + spec.add_development_dependency "base64" # Required for Ruby 3.4+ spec.add_development_dependency "bundler", "~> 2.0" spec.add_development_dependency "dotenv", "~> 2.0" spec.add_development_dependency "pry", "~> 0.14" diff --git a/lib/kickplan/concurrency.rb b/lib/kickplan/concurrency.rb index 78cc6fb..22b8289 100644 --- a/lib/kickplan/concurrency.rb +++ b/lib/kickplan/concurrency.rb @@ -33,7 +33,13 @@ def unset(name) private def memoization_variable(name) - ["@", name.to_s].join + # Extract just the method name from patterns like "Kickplan::Client#adapter" + method_name = name.to_s.split('#').last || name.to_s + # Replace any non-alphanumeric characters with underscores + sanitized = method_name.gsub(/[^a-zA-Z0-9_]/, '_') + # Ensure it starts with a letter or underscore + sanitized = "_#{sanitized}" unless sanitized.match?(/\A[a-zA-Z_]/) + ["@", sanitized].join end module Initializer