Skip to content

Commit

Permalink
fix: regex match syntax for ruby 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
danini-the-panini committed Oct 22, 2021
1 parent 82ebc49 commit e8176d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/kdl/types/duration/iso8601_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def finished?

# Parses number which can be a float with either comma or period.
def number
PERIOD_OR_COMMA.match?(scanner[1]) ? scanner[1].tr(COMMA, PERIOD).to_f : scanner[1].to_i
(PERIOD_OR_COMMA =~ scanner[1]) ? scanner[1].tr(COMMA, PERIOD).to_f : scanner[1].to_i
end

def scan(pattern)
Expand Down
2 changes: 1 addition & 1 deletion lib/kdl/types/uuid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.call(value, type = 'uuid')
return nil unless value.is_a? ::KDL::Value::String

uuid = value.value.downcase
raise ArgumentError, "`#{value.value}' is not a valid uuid" unless uuid.match?(RGX)
raise ArgumentError, "`#{value.value}' is not a valid uuid" unless uuid =~ RGX

new(uuid, type: type)
end
Expand Down

0 comments on commit e8176d2

Please sign in to comment.