xmp2assert 12 → 13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xmp2assert/version.rb +1 -1
- data/lib/xmp2assert/xmp2rexp.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca1ec4816655792e3a7191b25a2215bd26ba9f0b
|
4
|
+
data.tar.gz: 1df637b6cdafa53ca5ee6719516f0e5f5d6e82d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 667fbe7d5bed82ce1bc54c4dd353b97d0aeaff04fa2ac112427c1123964d125b234b8100f4bd271aaa0cc5675d4de31f7c8e87facaf9faab7512388bf773d005
|
7
|
+
data.tar.gz: e0fecfd10bedc2fdfdbe3e7e428a0a9f697790238548450439ebb71e86a2c1f44e6467f5ed06cd229d642e176ca14bce91f97dea8693d2030ed0de638671ec25
|
data/lib/xmp2assert/version.rb
CHANGED
data/lib/xmp2assert/xmp2rexp.rb
CHANGED
@@ -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: '
|
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-
|
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.
|
250
|
+
rubygems_version: 2.6.11
|
251
251
|
signing_key:
|
252
252
|
specification_version: 4
|
253
253
|
summary: auto-generate assertions from `# =>` comments
|