link_header 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/link_header.rb +2 -2
- data/lib/link_header/version.rb +1 -1
- data/test/test_link_header.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29f53011773f9523430a2e54e6ac598dd1308e6e
|
4
|
+
data.tar.gz: e96be00339ce3dfe14b5af300c346007be925078
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de1d1b8621b272bd7fe65d475ac82d22a654bacc19fb7abccdd9cd393934e48ba695626a223354874587ab5bd1745b94d98d352bfe7a2e27dabd8521e40e0706
|
7
|
+
data.tar.gz: 87645cd17df192bbc7ef9caba36bc52ee8f2e947c312de2113dd080aa5e25f4d777c548daf402875084442a6c8a6fe8a0465a6358b3b8eb2e201aa5b7a0d44eb
|
data/lib/link_header.rb
CHANGED
@@ -91,8 +91,8 @@ class LinkHeader
|
|
91
91
|
href = scanner[1]
|
92
92
|
attrs = []
|
93
93
|
while scanner.scan(ATTR)
|
94
|
-
attr_name, token, quoted = scanner[1], scanner[3], scanner[4]
|
95
|
-
attrs.push([attr_name, token || quoted])
|
94
|
+
attr_name, token, quoted = scanner[1], scanner[3], scanner[4]
|
95
|
+
attrs.push([attr_name, token || quoted.gsub(/\\"/, '"')])
|
96
96
|
break unless scanner.scan(SEMI)
|
97
97
|
end
|
98
98
|
links.push(Link.new(href, attrs))
|
data/lib/link_header/version.rb
CHANGED
data/test/test_link_header.rb
CHANGED
@@ -58,7 +58,13 @@ class TestLinkHeader < Test::Unit::TestCase
|
|
58
58
|
def test_link_header_to_s
|
59
59
|
assert_equal(LINK_HEADER_S, LinkHeader.new(LINK_HEADER_A).to_s)
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
|
+
def test_parse_token
|
63
|
+
link = LinkHeader.parse('</foo>; rel=self').links[0]
|
64
|
+
assert_equal("/foo", link.href)
|
65
|
+
assert_equal([["rel", "self"]], link.attr_pairs)
|
66
|
+
end
|
67
|
+
|
62
68
|
def test_parse_href
|
63
69
|
assert_equal("any old stuff!", LinkHeader.parse('<any old stuff!>').links[0].href)
|
64
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: link_header
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Burrows
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|