xmp2assert 10 → 11

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: 26e879357ce12c574820034db5f05273c9198a5f
4
- data.tar.gz: '0085d029684adb882d25989f0307f2339543d62d'
3
+ metadata.gz: 45061563c460b60b3b9b9a9c9cdc08fdd00da562
4
+ data.tar.gz: 0af4015708d764defe90793c4d3be3fb9e5384d0
5
5
  SHA512:
6
- metadata.gz: d8969151b32e0b072c23c4a05dcaa92fcf7fc906c7f15e39b5dd725aea94e874967fa9b19b7ce6978d45134f37458742f506b90d95abced467061607ed244991
7
- data.tar.gz: 98189ee6e18f776664719f97c510948ef43ab5db92b767f08585df391fa5d670afab4524779f32bc9d90fa3d58923b921f184062acc174bcb137bf079cb7c773
6
+ metadata.gz: 9c7e59307031b64e753d3252fb94dd733c820077aaf794320eec65e288bd1166bb52ef9d556d44fb039c150b080a26854e80f3a95df24e6c230ea2b0c3c4f820
7
+ data.tar.gz: b519801bad8bd7f1193fe5957e9547e9c3d5ee1555d7a5bdd5644578fa8f6ce0f88fd02236c63b5571ef82dfd81afbad9071c947a294292c36dfcca5c91ffada
@@ -24,4 +24,4 @@
24
24
  # SOFTWARE.
25
25
  ;
26
26
 
27
- XMP2Assert::VERSION = 10
27
+ XMP2Assert::VERSION = 11
@@ -48,11 +48,16 @@ module XMP2Assert::XMP2Rexp
48
48
  # :NOTE: we are editing regular expressions using regular expressions. In
49
49
  # order to hack this method you must be a seasoned regular expression
50
50
  # craftsperson who can count backslashes at ease.
51
+ nln = /\n*\z/.match(xmp).to_s.length
51
52
  src = Regexp.escape xmp.strip
52
53
  src.gsub!(/([^\\])(\\n|\\ )+/, '\\1\s+')
53
54
  src.gsub!(/(#<[\w:]+?:)0x[0-9a-f]+/, '\\10x[0-9a-f]+')
54
55
  src.gsub!(/\\\.rb:\d+/, '\\.rb:\d+')
55
56
 
56
- return Regexp.new "\\A#{src}\\n?\\z"
57
+ case nln when 0, 1 then
58
+ return Regexp.new "\\A#{src}\\n?\\z"
59
+ else
60
+ return Regexp.new "\\A#{src}\\n{#{nln}}\\z"
61
+ end
57
62
  end
58
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmp2assert
3
3
  version: !ruby/object:Gem::Version
4
- version: '10'
4
+ version: '11'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Urabe, Shyouhei