diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 9e87344d..5b05c69d 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ '3.0', 2.7, 2.6, 2.5, 2.4, head, jruby-9.2.17.0, jruby-head ] + ruby: [ '3.0', 2.7, 2.6, 2.5, head, jruby-9.2.17.0, jruby-head ] steps: - uses: actions/checkout@v2 - name: Set up Ruby diff --git a/lib/racc/statetransitiontable.rb b/lib/racc/statetransitiontable.rb index 4252ba01..4d542872 100644 --- a/lib/racc/statetransitiontable.rb +++ b/lib/racc/statetransitiontable.rb @@ -12,12 +12,6 @@ require 'racc/parser' -unless Object.method_defined?(:funcall) - class Object - alias funcall __send__ - end -end - module Racc StateTransitionTable = Struct.new(:action_table, @@ -300,9 +294,9 @@ def define_actions(c) c.module_eval "def _reduce_none(vals, vstack) vals[0] end" @grammar.each do |rule| if rule.action.empty? - c.funcall(:alias_method, "_reduce_#{rule.ident}", :_reduce_none) + c.alias_method("_reduce_#{rule.ident}", :_reduce_none) else - c.funcall(:define_method, "_racc_action_#{rule.ident}", &rule.action.proc) + c.define_method("_racc_action_#{rule.ident}", &rule.action.proc) c.module_eval(<<-End, __FILE__, __LINE__ + 1) def _reduce_#{rule.ident}(vals, vstack) _racc_action_#{rule.ident}(*vals) diff --git a/racc.gemspec b/racc.gemspec index 1157a8f6..cf98f93b 100644 --- a/racc.gemspec +++ b/racc.gemspec @@ -89,7 +89,7 @@ DESC "doc/en/Overview-of-racc.md" ] s.require_paths = ["lib"] - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.required_ruby_version = ">= 2.5" s.rdoc_options = ["--main", "README.rdoc"] s.extra_rdoc_files = [ "README.ja.rdoc", "README.rdoc",