jsl-http_headers 0.0.2.1 → 0.0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +6 -1
- data/http_headers.gemspec +3 -2
- data/spec/fixtures/headers3.txt +13 -0
- metadata +3 -2
data/README.rdoc
CHANGED
@@ -7,6 +7,11 @@ string formats.
|
|
7
7
|
It correctly parses the content type, response code and most other key-value fields from the HTTP response header,
|
8
8
|
including keys that may appear multiple times in the header such as Set-Cookie.
|
9
9
|
|
10
|
+
While parsing these header strings seems a very easy thing to do, the small variances in HTTP server responses make
|
11
|
+
it more challenging to process these strings than it may initially appear. This library tries to account for these
|
12
|
+
server variances by including a comprehensive test suite of HTTP header strings that the library has been tested
|
13
|
+
against.
|
14
|
+
|
10
15
|
== Installation
|
11
16
|
|
12
17
|
Set up your machine to pull gems from gems.github.com if you haven't already. Then:
|
@@ -26,7 +31,7 @@ Just require the library, create a new HttpHeaders object with the header string
|
|
26
31
|
Other methods should just work for arbitrary attributes by lowercasing the attribute name and substituting
|
27
32
|
hyphens with underscores.
|
28
33
|
|
29
|
-
== Implementation
|
34
|
+
== Implementation Notes
|
30
35
|
|
31
36
|
HttpHeaders uses ruby's +method_missing+ in order to build queries for the given parameter dynamically, so
|
32
37
|
it doesn't need to parse values for every field at the time that the HttpHeader object is instantiated with
|
data/http_headers.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "http_headers"
|
3
|
-
s.version = "0.0.2.
|
3
|
+
s.version = "0.0.2.2"
|
4
4
|
s.date = "2009-05-25"
|
5
5
|
s.summary = "Library for parsing the Curl header_str into attributes"
|
6
6
|
s.email = "justin@phq.org"
|
7
|
-
s.homepage = "http://github.com/jsl/
|
7
|
+
s.homepage = "http://github.com/jsl/http_headers"
|
8
8
|
s.description = "Parses a HTTP header string into individual header fields"
|
9
9
|
s.has_rdoc = true
|
10
10
|
s.authors = ["Justin Leitgeb"]
|
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
"spec/http_headers_spec.rb",
|
18
18
|
"spec/fixtures/headers.txt",
|
19
19
|
"spec/fixtures/headers2.txt",
|
20
|
+
"spec/fixtures/headers3.txt",
|
20
21
|
"lib/http_headers.rb"
|
21
22
|
]
|
22
23
|
s.test_files = [
|
@@ -0,0 +1,13 @@
|
|
1
|
+
HTTP/1.1 200 OK
|
2
|
+
Date: Mon, 25 May 2009 12:36:53 GMT
|
3
|
+
Server: Apache/2
|
4
|
+
Last-Modified: Wed, 01 Sep 2004 13:24:52 GMT
|
5
|
+
ETag: "1edec-3e3073913b100"
|
6
|
+
Accept-Ranges: bytes
|
7
|
+
Content-Length: 126444
|
8
|
+
Cache-Control: max-age=21600
|
9
|
+
Expires: Mon, 25 May 2009 18:36:53 GMT
|
10
|
+
P3P: policyref="http://www.w3.org/2001/05/P3P/p3p.xml"
|
11
|
+
Connection: close
|
12
|
+
Content-Type: text/html; charset=iso-8859-1
|
13
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsl-http_headers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.2.
|
4
|
+
version: 0.0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Leitgeb
|
@@ -29,9 +29,10 @@ files:
|
|
29
29
|
- spec/http_headers_spec.rb
|
30
30
|
- spec/fixtures/headers.txt
|
31
31
|
- spec/fixtures/headers2.txt
|
32
|
+
- spec/fixtures/headers3.txt
|
32
33
|
- lib/http_headers.rb
|
33
34
|
has_rdoc: true
|
34
|
-
homepage: http://github.com/jsl/
|
35
|
+
homepage: http://github.com/jsl/http_headers
|
35
36
|
post_install_message:
|
36
37
|
rdoc_options:
|
37
38
|
- --title
|