xmp2assert 12 → 13

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: b2f9ee081b57585fdaa4fc1c04b600b67ed9fcd5
4
- data.tar.gz: b32bbf297c76a0934b71281fb5e90f94608eb894
3
+ metadata.gz: ca1ec4816655792e3a7191b25a2215bd26ba9f0b
4
+ data.tar.gz: 1df637b6cdafa53ca5ee6719516f0e5f5d6e82d7
5
5
  SHA512:
6
- metadata.gz: b1cb6e90a0cd31ed34c49e85cf2c3c8cd0bd1c0311ba1b9d689f7ee0de19aa7a40feba7bb124025879f51fa53d64404f2037e96cafb80325197bda38e2325821
7
- data.tar.gz: 4a47c5aedb2283c6a0acaf7832d3c8bbf525afeb613080ec24cbbbf4796f1dd87051526ce66c211d182218930ffef7e0cc4d579255631c9a55532e073af996f2
6
+ metadata.gz: 667fbe7d5bed82ce1bc54c4dd353b97d0aeaff04fa2ac112427c1123964d125b234b8100f4bd271aaa0cc5675d4de31f7c8e87facaf9faab7512388bf773d005
7
+ data.tar.gz: e0fecfd10bedc2fdfdbe3e7e428a0a9f697790238548450439ebb71e86a2c1f44e6467f5ed06cd229d642e176ca14bce91f97dea8693d2030ed0de638671ec25
@@ -24,4 +24,4 @@
24
24
  # SOFTWARE.
25
25
  ;
26
26
 
27
- XMP2Assert::VERSION = 12
27
+ XMP2Assert::VERSION = 13
@@ -50,6 +50,17 @@ class XMP2Assert::XMP2Rexp
50
50
  src = Regexp.escape xmp.strip
51
51
  src.gsub!(/([^\\])(\\n|\\ )+/, '\\1\s+')
52
52
  src.gsub!(/(#<[\w:]+?:)0x[0-9a-f]+/, '\\10x[0-9a-f]+')
53
+ src.gsub!(/\\u\\{([0-9a-f]{1,4})\\}/) {
54
+ str = $1
55
+ len = 4 - str.length
56
+ pad = '0' * len
57
+ next sprintf '\\u(?:%s%s|\\{%s\\})', pad, str.upcase, str
58
+ }
59
+ src.gsub!(/\\u([0-9A-F]{4})/) {
60
+ str = $1
61
+ hex = str.each_char.drop_while {|i| i == '0' }.join # :FIXME: slow?
62
+ next sprintf '\\u(?:%s|\\{%s\\})', str, hex.downcase
63
+ }
53
64
  src.gsub!(/\\\.rb:\d+/, '\\.rb:\d+')
54
65
 
55
66
  case nln when 0, 1 then
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmp2assert
3
3
  version: !ruby/object:Gem::Version
4
- version: '12'
4
+ version: '13'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Urabe, Shyouhei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-16 00:00:00.000000000 Z
11
+ date: 2017-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  version: '0'
248
248
  requirements: []
249
249
  rubyforge_project:
250
- rubygems_version: 2.5.2
250
+ rubygems_version: 2.6.11
251
251
  signing_key:
252
252
  specification_version: 4
253
253
  summary: auto-generate assertions from `# =>` comments