Skip to content

Commit

Permalink
Merge pull request #134 from magni-/pp/ruby-3.2-fix
Browse files Browse the repository at this point in the history
Test against Ruby 3.2, fix broken things
  • Loading branch information
jkowens authored Jul 22, 2022
2 parents 1f6e43d + 8be5bd4 commit 99b4b46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, truffleruby]
ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, head, truffleruby]
include:
- { ruby: jruby-9.3, allow-failure: true }
steps:
Expand Down
2 changes: 2 additions & 0 deletions mustermann/lib/mustermann/ast/expander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def error_for(values)
# @see Mustermann::AST::Translator#expand
# @!visibility private
ruby2_keywords def escape(string, *args)
return super unless string.respond_to?(:=~)

# URI::Parser is pretty slow, let's not send every string to it, even if it's unnecessary
string =~ /\A\w*\Z/ ? string : super
end
Expand Down
4 changes: 2 additions & 2 deletions mustermann/lib/mustermann/ast/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def self.constant_name(name)
# Helper for creating a new instance and calling #parse on it.
# @return [Mustermann::AST::Node]
# @!visibility private
def self.parse(*args, &block)
new(*args).tap { |n| n.parse(&block) }
def self.parse(payload = nil, **options, &block)
new(payload, **options).tap { |n| n.parse(&block) }
end

# @!visibility private
Expand Down

0 comments on commit 99b4b46

Please sign in to comment.