konjak 0.0.11 → 0.0.12

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
  SHA1:
3
- metadata.gz: 43ecc6e76ae210cbd9611a53eba7e8b2ea6a4c26
4
- data.tar.gz: 3d97b81314095d92403a41eb630bd6831b15b126
3
+ metadata.gz: 2b3737eb910538d760657c5e527b35be1fc9599f
4
+ data.tar.gz: 85f858f6a152cf53b32e6b831b737d8729712437
5
5
  SHA512:
6
- metadata.gz: 88658975451acdf0265ad0ac4b8f5dd9aae6f026633829368f4f22b61859513624d36e593cd8c2369a5735bd2665ead0e8ee05231c07a26c193c9f692eb49d00
7
- data.tar.gz: 23a9a0d8c14cd335421722ea1259e5f35e0d694b168080c73a3d548f69a2803fa60d9374ea14c28e503201b7203fad8c980b1e07630eacfce712fc1b2e3dfd78
6
+ metadata.gz: 38622d0a0d77bb334554e0cb5fde0cf8226c1eab06bfec5e86e5a202174c61acd9b83de34ec297299acd4974b1cc85198500591685daaf4e2d7adf77c435ed1f
7
+ data.tar.gz: bb75de764a2a6722e5435be2f3ca3acd6d39147013630892a8072fadeefadc3bee28f3614327668d98f5843d3ac74756600b1168dfa56def824b70a8253e4430
@@ -17,8 +17,7 @@ module Konjak
17
17
 
18
18
  def compile_pattern
19
19
  regexp = Regexp.escape(text)
20
- regexp = regexp.gsub(/(\\\s|\n)/m) { '\s+' }
21
- regexp = regexp.gsub(/(\\s\+)+/) {|s| ('\s' * (s.size / '\s+'.size)) + '+' }
20
+ regexp = regexp.gsub(/(?:\\\s|\n)/m) { '\s' }
22
21
  Regexp.compile(regexp)
23
22
  end
24
23
 
@@ -10,8 +10,7 @@ module Konjak
10
10
  regexp = regexp.gsub(/\\\{#{n}\\\}/) { "\\k<n#{n}>" }
11
11
  regexp = regexp.gsub(/\\\{\/#{n}\\\}/) { "</\\k<_#{n}>>" }
12
12
  end
13
- regexp = regexp.gsub(/(\\\s|\n)/m) { '\s+' }
14
- regexp = regexp.gsub(/(\\s\+)+/) {|s| ('\s' * (s.size / '\s+'.size)) + '+' }
13
+ regexp = regexp.gsub(/(?:\\\s|\n)/m) { '\s' }
15
14
  Regexp.compile(regexp)
16
15
  end
17
16
 
@@ -1,3 +1,3 @@
1
1
  module Konjak
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -19,9 +19,8 @@ EXPECT
19
19
 
20
20
  context 'when blanks between words is not exactly match' do
21
21
  let(:doc) { <<DOC }
22
- this is data (with a non-standard
23
-
24
- character: ).
22
+ this is data
23
+ (with a non-standard character: ).
25
24
  this is data (with a non-standard character: ).
26
25
  DOC
27
26
 
@@ -54,11 +53,10 @@ EXPECT
54
53
 
55
54
  context 'when blanks between words is not exactly match' do
56
55
  let(:doc) { <<GTT_HTML }
57
- This is <a href="http://example.com">example</a>.
56
+ This is
57
+ <a href="http://example.com">example</a>.
58
58
  And This
59
59
  is
60
-
61
-
62
60
  <b>example</b>. Yey.
63
61
  And This is example.
64
62
  GTT_HTML
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: konjak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seiei Higa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-24 00:00:00.000000000 Z
11
+ date: 2015-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mem