konjak 0.0.9 → 0.0.10

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: 9a1dc76b9a5796b66e6c6b50c4400143fd497492
4
- data.tar.gz: 9ac877e8c999059b43400aad5a59f18109dc331b
3
+ metadata.gz: 29484a9e63b485e559b41dca4a526535cf770c18
4
+ data.tar.gz: 8d91043131275ad2977dd8430d352ca4e6229455
5
5
  SHA512:
6
- metadata.gz: 356f541c8ce211f7811061fe0cd61d63cb2f4536506a9f80f5332c0893ab24a9a11d50d37e81c52b0ccefdf9f2f0a1734d9e9a49c0c2b6eac21358fa621d570e
7
- data.tar.gz: 42f02f58909edb6fcaa884b10c5bfa3c79866fd3eb29686c7be64fed0f2577d3b080466f34c0baa5b925a0e3d9384055c49bab0bbbac6a99b6182a523b483a40
6
+ metadata.gz: 17d33b3f64c467ef0fa29c18b4b96ef50c319fdf96f3dab1ade86b4cef1dcd01265738ff4a2828086d0600886c6ff6f8b2b0c0825be2cd7d81ffe7d33114b1c7
7
+ data.tar.gz: b4229903cadcc6ffabe7da76f9cca328e4cb5059692da16acb83924b6d9be86ada2e834ea1ad0db9aaf9450d5b401bdc2c7627122fe2b399681c4c29c9f413e2
@@ -10,7 +10,8 @@ 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+' }
13
+ regexp = regexp.gsub(/(\\\s|\n)/m) { '\s+' }
14
+ regexp = regexp.gsub(/(\\s\+)+/) {|s| ('\s' * (s.size / '\s+'.size)) + '+' }
14
15
  Regexp.compile(regexp)
15
16
  end
16
17
 
@@ -18,6 +18,7 @@ module Konjak
18
18
  def compile_pattern
19
19
  regexp = Regexp.escape(text)
20
20
  regexp = regexp.gsub(/(\\\s|\n)/m) { '\s+' }
21
+ regexp = regexp.gsub(/(\\s\+)+/) {|s| ('\s' * (s.size / '\s+'.size)) + '+' }
21
22
  Regexp.compile(regexp)
22
23
  end
23
24
 
@@ -1,3 +1,3 @@
1
1
  module Konjak
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
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.9
4
+ version: 0.0.10
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-23 00:00:00.000000000 Z
11
+ date: 2015-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mem