Skip to content

Commit

Permalink
Merge pull request #62 from apsislabs/feature/ruby-32
Browse files Browse the repository at this point in the history
Add support for Ruby 3.2
  • Loading branch information
wkirby authored Feb 13, 2024
2 parents ee59f1e + 7282b9d commit 6406e86
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:

strategy:
matrix:
ruby-version: ['3.1', '3.0', '2.7']
ruby-version: ['3.3', '3.2', '3.1', '3.0', '2.7']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.1.2-alpine
FROM ruby:3.2-alpine

RUN apk add --no-cache --update \
bash \
Expand Down
8 changes: 4 additions & 4 deletions lib/slayer/command.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module Slayer
class Command
class << self
def call(*args, &block)
def call(*args, **kwargs, &block)
instance = self.new

res = __get_result(instance, *args, &block)
res = __get_result(instance, *args, **kwargs, &block)
handle_match(res, instance, block) if block_given?

raise CommandNotImplementedError unless res.is_a? Result
Expand All @@ -28,11 +28,11 @@ def err!(value: nil, status: :default, message: nil)
raise ResultFailureError, err(value: value, status: status, message: message)
end

def __get_result(instance, *args, &block)
def __get_result(instance, *args, **kwargs, &block)
res = nil

begin
res = instance.call(*args, &block)
res = instance.call(*args, **kwargs, &block)
rescue ResultFailureError => e
res = e.result
end
Expand Down

0 comments on commit 6406e86

Please sign in to comment.