1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-18 05:21:47 +03:00
mobile-nixos/overlay/mruby-builder/mrbgems/mruby-regexp-pcre/0001-Fix-String-match-removed-in-mruby-2.1.0.patch
Samuel Dionne-Riel 6f8a8ee208 mruby-builder: Import mruby-builder
This overlay allows building bespoke binaries using mruby with a
custom-made builder.

This may evolve a bit with *actual* use.
2020-02-03 16:19:10 -05:00

36 lines
962 B
Diff
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From ba5808220e95086b72be5f6e2ecf3f789a38ef2e Mon Sep 17 00:00:00 2001
From: Samuel Dionne-Riel <samuel@dionne-riel.com>
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