opal-onigmo 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -4
- data/lib/opal/onigmo/version.rb +1 -1
- data/opal/onigmo/core_ext.rb +9 -0
- data/opal/onigmo/regexp.rb +2 -0
- metadata +2 -3
- data/LICENSE.txt +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90f5abfe1cbe8a3717060f24da7fb7cd3be82ac2d5de11430ca05d9659aa28ea
|
4
|
+
data.tar.gz: 22483651f8773c3e863315b2df45c242f635c1045f24d5097e92add79194d2d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0970bc00831306a655eff2b7ea482b32046b4e8a1280261c421797b03fa76c5b608031e85946145b0c5ac53ff4accd96f1a90f5cebb90a31b4fc8dab759e9da0'
|
7
|
+
data.tar.gz: 3c9eada3c55ea6c2c85e195208e6abc0a36943eac65758fc126d10866d352adcfbae85d85c6e1ed47792ecfbe426abbb963de5c3f51cc62b088bff302c3df065
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
opal-onigmo (0.1.
|
5
|
-
opal-webassembly
|
4
|
+
opal-onigmo (0.1.3)
|
5
|
+
opal-webassembly (~> 0.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -15,6 +15,9 @@ GEM
|
|
15
15
|
method_source (1.0.0)
|
16
16
|
mini_racer (0.3.1)
|
17
17
|
libv8 (~> 8.4.255)
|
18
|
+
opal (1.0.3)
|
19
|
+
ast (>= 2.3.0)
|
20
|
+
parser (~> 2.6)
|
18
21
|
opal-rspec (0.8.0.alpha2)
|
19
22
|
opal (>= 0.11, < 1.1)
|
20
23
|
opal-sprockets
|
@@ -25,7 +28,7 @@ GEM
|
|
25
28
|
tilt (>= 1.4)
|
26
29
|
opal-webassembly (0.1.0)
|
27
30
|
opal
|
28
|
-
parser (2.7.
|
31
|
+
parser (2.7.2.0)
|
29
32
|
ast (~> 2.4.1)
|
30
33
|
pry (0.13.1)
|
31
34
|
coderay (~> 1.1)
|
@@ -55,7 +58,7 @@ PLATFORMS
|
|
55
58
|
|
56
59
|
DEPENDENCIES
|
57
60
|
mini_racer
|
58
|
-
opal
|
61
|
+
opal (~> 1.0)
|
59
62
|
opal-onigmo!
|
60
63
|
opal-rspec
|
61
64
|
opal-webassembly
|
data/lib/opal/onigmo/version.rb
CHANGED
data/opal/onigmo/core_ext.rb
CHANGED
@@ -22,6 +22,7 @@ class String
|
|
22
22
|
alias gsub_before_onigmo gsub
|
23
23
|
def gsub(from, to = undefined, &block)
|
24
24
|
if Onigmo::Regexp === from
|
25
|
+
from.reset
|
25
26
|
out = []
|
26
27
|
index = 0
|
27
28
|
loop do
|
@@ -71,4 +72,12 @@ class String
|
|
71
72
|
gsub_before_onigmo(from, to, &block)
|
72
73
|
end
|
73
74
|
end
|
75
|
+
|
76
|
+
alias sub_before_onigmo sub
|
77
|
+
def sub(from, to = undefined, &block)
|
78
|
+
if Onigmo::Regexp === from
|
79
|
+
from.reset
|
80
|
+
end
|
81
|
+
sub_before_onigmo(from, to, &block)
|
82
|
+
end
|
74
83
|
end
|
data/opal/onigmo/regexp.rb
CHANGED
@@ -7,11 +7,13 @@ module Onigmo
|
|
7
7
|
`Opal.defineProperty(self.$$prototype, 'multiline', true)`
|
8
8
|
|
9
9
|
def match(str, offset=nil, &block)
|
10
|
+
self.reset
|
10
11
|
block ||= proc{|i| i}
|
11
12
|
evaluate(str, offset) && block.(MatchData.new(self, js_matches(str)))
|
12
13
|
end
|
13
14
|
|
14
15
|
def match?(str, offset=nil)
|
16
|
+
self.reset
|
15
17
|
!!evaluate(str, offset)
|
16
18
|
end
|
17
19
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-onigmo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal-webassembly
|
@@ -41,7 +41,6 @@ files:
|
|
41
41
|
- Gemfile
|
42
42
|
- Gemfile.lock
|
43
43
|
- LICENSE.adoc
|
44
|
-
- LICENSE.txt
|
45
44
|
- README.adoc
|
46
45
|
- Rakefile
|
47
46
|
- bin/console
|
data/LICENSE.txt
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2020 TODO: Write your name
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|