From ba5808220e95086b72be5f6e2ecf3f789a38ef2e Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Thu, 12 Dec 2019 22:29:56 -0500 Subject: [PATCH] Fix String#match removed in mruby 2.1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit String#=~ and String#match were removed from mruby for 2.0.1 * https://github.com/mruby/mruby/commit/fd37bc53deb2d52fe3134838eab002dfb9ac35ab String#=~ was already present, this adds the missing String#match. --- mrblib/string_pcre.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mrblib/string_pcre.rb b/mrblib/string_pcre.rb index c9a7375..78d9acb 100644 --- a/mrblib/string_pcre.rb +++ b/mrblib/string_pcre.rb @@ -71,6 +71,10 @@ class String end end + def match(re, &block) + Regexp.new(re).match(self, &block) + end + alias_method :old_split, :split def split(*args, &blk) return [] if self.empty? -- 2.23.0