Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Improve Ruby 2.6 compatibility hack
Browse files Browse the repository at this point in the history
  • Loading branch information
kodnin committed Aug 11, 2021
1 parent 5caf08c commit 053b755
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/image_vise/pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ def empty?
@ops.empty?
end

if RUBY_VERSION.start_with?("2.6")
def method_missing(method_name, *args, &blk)
operator_builder = ImageVise.operator_from(method_name)
def method_missing(method_name, args = {}, &blk)
operator_builder = ImageVise.operator_from(method_name)

if RUBY_VERSION.start_with?("2.6") # TODO: remove after dropping Ruby 2.6 support
self << operator_builder.new(*args)
end
else
def method_missing(method_name, args = {}, &blk)
operator_builder = ImageVise.operator_from(method_name)
else
self << operator_builder.new(**args)
end
end
Expand Down

0 comments on commit 053b755

Please sign in to comment.