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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 594d887d655a6daa87f4bfe2b2bfe4c9b708f57d
4
- data.tar.gz: 973bd078f4442ed12d0b6db9716f7d3e07e8702b
3
+ metadata.gz: 29f53011773f9523430a2e54e6ac598dd1308e6e
4
+ data.tar.gz: e96be00339ce3dfe14b5af300c346007be925078
5
5
  SHA512:
6
- metadata.gz: bacfb5be464da48c4b97b55f2b94a788cb5984b97e1a2058dfe0f8d035580215fac9e5216c87260c9d55ed7294b4ec16e801f459f9bb433865baffedcfae4889
7
- data.tar.gz: d238f95e02599bb224f44c36681990065ea93d93ea389f1cae8a6705958f419b5ece482da2cee399cbf4349a340310ad0a3d8b33ac5e3ad1196e6967e459bae4
6
+ metadata.gz: de1d1b8621b272bd7fe65d475ac82d22a654bacc19fb7abccdd9cd393934e48ba695626a223354874587ab5bd1745b94d98d352bfe7a2e27dabd8521e40e0706
7
+ data.tar.gz: 87645cd17df192bbc7ef9caba36bc52ee8f2e947c312de2113dd080aa5e25f4d777c548daf402875084442a6c8a6fe8a0465a6358b3b8eb2e201aa5b7a0d44eb
@@ -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].gsub(/\\"/, '"')
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))
@@ -1,3 +1,3 @@
1
1
  class LinkHeader
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -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.7
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-06-13 00:00:00.000000000 Z
11
+ date: 2013-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler