From 5af1a42a3bd2b5e0401e6198a7b3a7af245ef18b Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 22 Jun 2021 18:16:36 +0900 Subject: [PATCH 1/3] Drop to support Ruby 2.4 --- .github/workflows/ubuntu.yml | 2 +- racc.gemspec | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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/racc.gemspec b/racc.gemspec index 1157a8f6..7826449a 100644 --- a/racc.gemspec +++ b/racc.gemspec @@ -90,6 +90,7 @@ DESC ] 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", From fe3183b1ffae4f6ab7ee355a64140ac2212c4401 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 22 Jun 2021 18:17:06 +0900 Subject: [PATCH 2/3] Removed needless condition for old versions of RubyGems. --- racc.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/racc.gemspec b/racc.gemspec index 7826449a..cf98f93b 100644 --- a/racc.gemspec +++ b/racc.gemspec @@ -89,7 +89,6 @@ 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 = [ From 464485e912c00e4cf14baeb96375231a8de4c6e0 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 27 Apr 2021 11:49:20 -0700 Subject: [PATCH 3/3] Remove Object monkey patch I don't think we need this monkey patch anymore, so lets remove it! --- lib/racc/statetransitiontable.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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)