Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .github/workflows/main.yml

This file was deleted.

41 changes: 19 additions & 22 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.4.4
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -79,6 +82,7 @@ PLATFORMS
ruby

DEPENDENCIES
base64
bundler (~> 2.0)
dotenv (~> 2.0)
kickplan-sdk!
Expand Down
Binary file modified kickplan-sdk-0.1.0.gem
Binary file not shown.
2 changes: 2 additions & 0 deletions kickplan.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 7 additions & 1 deletion lib/kickplan/concurrency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down