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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec1caa38621cd815637b96284a30f5fb69f3049ccc759ff3e69a67ffc549c36a
4
- data.tar.gz: 7d544017614820e67e952612a2fd5ef2d5496cfdcc01ed18b174630c2051f578
3
+ metadata.gz: 90f5abfe1cbe8a3717060f24da7fb7cd3be82ac2d5de11430ca05d9659aa28ea
4
+ data.tar.gz: 22483651f8773c3e863315b2df45c242f635c1045f24d5097e92add79194d2d3
5
5
  SHA512:
6
- metadata.gz: e0d515da7c5d167ba85fee1cff7ffda106f6072568c0660c9e0997f0cff3499f621ae1472ac3c7175a2581a7b1b1c7f3ae33fea9868768bc3a250de7d419ce8c
7
- data.tar.gz: f026ce0c670a78d70ff41f53c32e89f90c91e6ed68a65fb1cc2cd18d956aec49fbf5e1b3c1f82dba1a9947c79268f0388fc5ebb34c36901814841973a3f160fd
6
+ metadata.gz: '0970bc00831306a655eff2b7ea482b32046b4e8a1280261c421797b03fa76c5b608031e85946145b0c5ac53ff4accd96f1a90f5cebb90a31b4fc8dab759e9da0'
7
+ data.tar.gz: 3c9eada3c55ea6c2c85e195208e6abc0a36943eac65758fc126d10866d352adcfbae85d85c6e1ed47792ecfbe426abbb963de5c3f51cc62b088bff302c3df065
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opal-onigmo (0.1.0)
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.1.5)
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
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Onigmo
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -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
@@ -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.2
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-05 00:00:00.000000000 Z
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
@@ -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.