brianmario-yajl-ruby 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +5 -0
- data/VERSION.yml +1 -1
- data/lib/yajl/http_stream.rb +5 -3
- data/{specs → spec}/active_support_spec.rb +0 -0
- data/{specs → spec}/fixtures/fail.15.json +0 -0
- data/{specs → spec}/fixtures/fail.16.json +0 -0
- data/{specs → spec}/fixtures/fail.17.json +0 -0
- data/{specs → spec}/fixtures/fail.26.json +0 -0
- data/{specs → spec}/fixtures/fail11.json +0 -0
- data/{specs → spec}/fixtures/fail12.json +0 -0
- data/{specs → spec}/fixtures/fail13.json +0 -0
- data/{specs → spec}/fixtures/fail14.json +0 -0
- data/{specs → spec}/fixtures/fail19.json +0 -0
- data/{specs → spec}/fixtures/fail20.json +0 -0
- data/{specs → spec}/fixtures/fail21.json +0 -0
- data/{specs → spec}/fixtures/fail22.json +0 -0
- data/{specs → spec}/fixtures/fail23.json +0 -0
- data/{specs → spec}/fixtures/fail24.json +0 -0
- data/{specs → spec}/fixtures/fail25.json +0 -0
- data/{specs → spec}/fixtures/fail27.json +0 -0
- data/{specs → spec}/fixtures/fail28.json +0 -0
- data/{specs → spec}/fixtures/fail3.json +0 -0
- data/{specs → spec}/fixtures/fail4.json +0 -0
- data/{specs → spec}/fixtures/fail5.json +0 -0
- data/{specs → spec}/fixtures/fail6.json +0 -0
- data/{specs → spec}/fixtures/fail9.json +0 -0
- data/{specs → spec}/fixtures/pass.array.json +0 -0
- data/{specs → spec}/fixtures/pass.codepoints_from_unicode_org.json +0 -0
- data/{specs → spec}/fixtures/pass.contacts.json +0 -0
- data/{specs → spec}/fixtures/pass.db100.xml.json +0 -0
- data/{specs → spec}/fixtures/pass.db1000.xml.json +0 -0
- data/{specs → spec}/fixtures/pass.dc_simple_with_comments.json +0 -0
- data/{specs → spec}/fixtures/pass.deep_arrays.json +0 -0
- data/{specs → spec}/fixtures/pass.difficult_json_c_test_case.json +0 -0
- data/{specs → spec}/fixtures/pass.difficult_json_c_test_case_with_comments.json +0 -0
- data/{specs → spec}/fixtures/pass.doubles.json +0 -0
- data/{specs → spec}/fixtures/pass.empty_array.json +0 -0
- data/{specs → spec}/fixtures/pass.empty_string.json +0 -0
- data/{specs → spec}/fixtures/pass.escaped_bulgarian.json +0 -0
- data/{specs → spec}/fixtures/pass.escaped_foobar.json +0 -0
- data/{specs → spec}/fixtures/pass.item.json +0 -0
- data/{specs → spec}/fixtures/pass.json-org-sample1.json +0 -0
- data/{specs → spec}/fixtures/pass.json-org-sample2.json +0 -0
- data/{specs → spec}/fixtures/pass.json-org-sample3.json +0 -0
- data/{specs → spec}/fixtures/pass.json-org-sample4-nows.json +0 -0
- data/{specs → spec}/fixtures/pass.json-org-sample4.json +0 -0
- data/{specs → spec}/fixtures/pass.json-org-sample5.json +0 -0
- data/{specs → spec}/fixtures/pass.map-spain.xml.json +0 -0
- data/{specs → spec}/fixtures/pass.ns-invoice100.xml.json +0 -0
- data/{specs → spec}/fixtures/pass.ns-soap.xml.json +0 -0
- data/{specs → spec}/fixtures/pass.numbers-fp-4k.json +0 -0
- data/{specs → spec}/fixtures/pass.numbers-fp-64k.json +0 -0
- data/{specs → spec}/fixtures/pass.numbers-int-4k.json +0 -0
- data/{specs → spec}/fixtures/pass.numbers-int-64k.json +0 -0
- data/{specs → spec}/fixtures/pass.twitter-search.json +0 -0
- data/{specs → spec}/fixtures/pass.twitter-search2.json +0 -0
- data/{specs → spec}/fixtures/pass.unicode.json +0 -0
- data/{specs → spec}/fixtures/pass.yelp.json +0 -0
- data/{specs → spec}/fixtures/pass1.json +0 -0
- data/{specs → spec}/fixtures/pass2.json +0 -0
- data/{specs → spec}/fixtures/pass3.json +0 -0
- data/{specs → spec}/fixtures_spec.rb +0 -0
- data/{specs → spec}/one_off_spec.rb +0 -0
- data/{specs → spec}/spec_helper.rb +0 -0
- data/yajl-ruby.gemspec +69 -63
- metadata +68 -65
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
= Changelog
|
2
2
|
|
3
|
+
0.4.3 (May 2nd, 2009)
|
4
|
+
* adding text/plain as an allowed mime-type for Yajl::HttpStream for webservers that respond
|
5
|
+
with it instead of application/json (ahem...Yelp...)
|
6
|
+
* renamed specs folder to spec for no reason at all
|
7
|
+
|
3
8
|
0.4.2 (April 30th, 2009)
|
4
9
|
* Yajl::HttpStream is now sending "proper" http request headers
|
5
10
|
* Yajl::HttpStream will request HTTP-Basic auth if credentials are provided in the passed URI
|
data/VERSION.yml
CHANGED
data/lib/yajl/http_stream.rb
CHANGED
@@ -17,7 +17,7 @@ module Yajl
|
|
17
17
|
|
18
18
|
# The mime-type we expect the response to be. If it's anything else, we can't parse it
|
19
19
|
# and an InvalidContentType is raised.
|
20
|
-
|
20
|
+
ALLOWED_MIME_TYPES = ["application/json", "text/plain"]
|
21
21
|
|
22
22
|
# Makes a basic HTTP GET request to the URI provided
|
23
23
|
# 1. a raw socket is opened to the server/host provided
|
@@ -58,14 +58,16 @@ module Yajl
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
|
61
|
+
content_type = response_head[:headers]["Content-Type"].split('; ')
|
62
|
+
content_type = content_type[0] if content_type.size > 1
|
63
|
+
if ALLOWED_MIME_TYPES.include?(content_type)
|
62
64
|
case response_head[:headers]["Content-Encoding"]
|
63
65
|
when "gzip"
|
64
66
|
socket = Yajl::GzipStreamReader.new(socket)
|
65
67
|
end
|
66
68
|
return Yajl::Stream.parse(socket)
|
67
69
|
else
|
68
|
-
raise InvalidContentType, "The response MIME type #{
|
70
|
+
raise InvalidContentType, "The response MIME type #{content_type}"
|
69
71
|
end
|
70
72
|
ensure
|
71
73
|
socket.close
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/yajl-ruby.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{yajl-ruby}
|
5
|
-
s.version = "0.4.
|
5
|
+
s.version = "0.4.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Brian Lopez"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-05-02}
|
10
10
|
s.email = %q{seniorlopez@gmail.com}
|
11
11
|
s.extensions = ["ext/extconf.rb"]
|
12
12
|
s.extra_rdoc_files = [
|
@@ -33,67 +33,67 @@ Gem::Specification.new do |s|
|
|
33
33
|
"ext/yajl.h",
|
34
34
|
"lib/yajl.rb",
|
35
35
|
"lib/yajl/http_stream.rb",
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
59
|
-
"
|
60
|
-
"
|
61
|
-
"
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"
|
65
|
-
"
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"
|
70
|
-
"
|
71
|
-
"
|
72
|
-
"
|
73
|
-
"
|
74
|
-
"
|
75
|
-
"
|
76
|
-
"
|
77
|
-
"
|
78
|
-
"
|
79
|
-
"
|
80
|
-
"
|
81
|
-
"
|
82
|
-
"
|
83
|
-
"
|
84
|
-
"
|
85
|
-
"
|
86
|
-
"
|
87
|
-
"
|
88
|
-
"
|
89
|
-
"
|
90
|
-
"
|
91
|
-
"
|
92
|
-
"
|
93
|
-
"
|
94
|
-
"
|
95
|
-
"
|
96
|
-
"
|
36
|
+
"spec/active_support_spec.rb",
|
37
|
+
"spec/fixtures/fail.15.json",
|
38
|
+
"spec/fixtures/fail.16.json",
|
39
|
+
"spec/fixtures/fail.17.json",
|
40
|
+
"spec/fixtures/fail.26.json",
|
41
|
+
"spec/fixtures/fail11.json",
|
42
|
+
"spec/fixtures/fail12.json",
|
43
|
+
"spec/fixtures/fail13.json",
|
44
|
+
"spec/fixtures/fail14.json",
|
45
|
+
"spec/fixtures/fail19.json",
|
46
|
+
"spec/fixtures/fail20.json",
|
47
|
+
"spec/fixtures/fail21.json",
|
48
|
+
"spec/fixtures/fail22.json",
|
49
|
+
"spec/fixtures/fail23.json",
|
50
|
+
"spec/fixtures/fail24.json",
|
51
|
+
"spec/fixtures/fail25.json",
|
52
|
+
"spec/fixtures/fail27.json",
|
53
|
+
"spec/fixtures/fail28.json",
|
54
|
+
"spec/fixtures/fail3.json",
|
55
|
+
"spec/fixtures/fail4.json",
|
56
|
+
"spec/fixtures/fail5.json",
|
57
|
+
"spec/fixtures/fail6.json",
|
58
|
+
"spec/fixtures/fail9.json",
|
59
|
+
"spec/fixtures/pass.array.json",
|
60
|
+
"spec/fixtures/pass.codepoints_from_unicode_org.json",
|
61
|
+
"spec/fixtures/pass.contacts.json",
|
62
|
+
"spec/fixtures/pass.db100.xml.json",
|
63
|
+
"spec/fixtures/pass.db1000.xml.json",
|
64
|
+
"spec/fixtures/pass.dc_simple_with_comments.json",
|
65
|
+
"spec/fixtures/pass.deep_arrays.json",
|
66
|
+
"spec/fixtures/pass.difficult_json_c_test_case.json",
|
67
|
+
"spec/fixtures/pass.difficult_json_c_test_case_with_comments.json",
|
68
|
+
"spec/fixtures/pass.doubles.json",
|
69
|
+
"spec/fixtures/pass.empty_array.json",
|
70
|
+
"spec/fixtures/pass.empty_string.json",
|
71
|
+
"spec/fixtures/pass.escaped_bulgarian.json",
|
72
|
+
"spec/fixtures/pass.escaped_foobar.json",
|
73
|
+
"spec/fixtures/pass.item.json",
|
74
|
+
"spec/fixtures/pass.json-org-sample1.json",
|
75
|
+
"spec/fixtures/pass.json-org-sample2.json",
|
76
|
+
"spec/fixtures/pass.json-org-sample3.json",
|
77
|
+
"spec/fixtures/pass.json-org-sample4-nows.json",
|
78
|
+
"spec/fixtures/pass.json-org-sample4.json",
|
79
|
+
"spec/fixtures/pass.json-org-sample5.json",
|
80
|
+
"spec/fixtures/pass.map-spain.xml.json",
|
81
|
+
"spec/fixtures/pass.ns-invoice100.xml.json",
|
82
|
+
"spec/fixtures/pass.ns-soap.xml.json",
|
83
|
+
"spec/fixtures/pass.numbers-fp-4k.json",
|
84
|
+
"spec/fixtures/pass.numbers-fp-64k.json",
|
85
|
+
"spec/fixtures/pass.numbers-int-4k.json",
|
86
|
+
"spec/fixtures/pass.numbers-int-64k.json",
|
87
|
+
"spec/fixtures/pass.twitter-search.json",
|
88
|
+
"spec/fixtures/pass.twitter-search2.json",
|
89
|
+
"spec/fixtures/pass.unicode.json",
|
90
|
+
"spec/fixtures/pass.yelp.json",
|
91
|
+
"spec/fixtures/pass1.json",
|
92
|
+
"spec/fixtures/pass2.json",
|
93
|
+
"spec/fixtures/pass3.json",
|
94
|
+
"spec/fixtures_spec.rb",
|
95
|
+
"spec/one_off_spec.rb",
|
96
|
+
"spec/spec_helper.rb",
|
97
97
|
"yajl-ruby.gemspec"
|
98
98
|
]
|
99
99
|
s.has_rdoc = true
|
@@ -102,6 +102,12 @@ Gem::Specification.new do |s|
|
|
102
102
|
s.require_paths = ["lib", "ext"]
|
103
103
|
s.rubygems_version = %q{1.3.2}
|
104
104
|
s.summary = %q{Ruby C bindings to the excellent Yajl JSON stream-based parser library.}
|
105
|
+
s.test_files = [
|
106
|
+
"spec/active_support_spec.rb",
|
107
|
+
"spec/fixtures_spec.rb",
|
108
|
+
"spec/one_off_spec.rb",
|
109
|
+
"spec/spec_helper.rb"
|
110
|
+
]
|
105
111
|
|
106
112
|
if s.respond_to? :specification_version then
|
107
113
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brianmario-yajl-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Lopez
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-02 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -42,67 +42,67 @@ files:
|
|
42
42
|
- ext/yajl.h
|
43
43
|
- lib/yajl.rb
|
44
44
|
- lib/yajl/http_stream.rb
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
-
|
50
|
-
-
|
51
|
-
-
|
52
|
-
-
|
53
|
-
-
|
54
|
-
-
|
55
|
-
-
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
-
|
84
|
-
-
|
85
|
-
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
-
|
89
|
-
-
|
90
|
-
-
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
102
|
-
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
45
|
+
- spec/active_support_spec.rb
|
46
|
+
- spec/fixtures/fail.15.json
|
47
|
+
- spec/fixtures/fail.16.json
|
48
|
+
- spec/fixtures/fail.17.json
|
49
|
+
- spec/fixtures/fail.26.json
|
50
|
+
- spec/fixtures/fail11.json
|
51
|
+
- spec/fixtures/fail12.json
|
52
|
+
- spec/fixtures/fail13.json
|
53
|
+
- spec/fixtures/fail14.json
|
54
|
+
- spec/fixtures/fail19.json
|
55
|
+
- spec/fixtures/fail20.json
|
56
|
+
- spec/fixtures/fail21.json
|
57
|
+
- spec/fixtures/fail22.json
|
58
|
+
- spec/fixtures/fail23.json
|
59
|
+
- spec/fixtures/fail24.json
|
60
|
+
- spec/fixtures/fail25.json
|
61
|
+
- spec/fixtures/fail27.json
|
62
|
+
- spec/fixtures/fail28.json
|
63
|
+
- spec/fixtures/fail3.json
|
64
|
+
- spec/fixtures/fail4.json
|
65
|
+
- spec/fixtures/fail5.json
|
66
|
+
- spec/fixtures/fail6.json
|
67
|
+
- spec/fixtures/fail9.json
|
68
|
+
- spec/fixtures/pass.array.json
|
69
|
+
- spec/fixtures/pass.codepoints_from_unicode_org.json
|
70
|
+
- spec/fixtures/pass.contacts.json
|
71
|
+
- spec/fixtures/pass.db100.xml.json
|
72
|
+
- spec/fixtures/pass.db1000.xml.json
|
73
|
+
- spec/fixtures/pass.dc_simple_with_comments.json
|
74
|
+
- spec/fixtures/pass.deep_arrays.json
|
75
|
+
- spec/fixtures/pass.difficult_json_c_test_case.json
|
76
|
+
- spec/fixtures/pass.difficult_json_c_test_case_with_comments.json
|
77
|
+
- spec/fixtures/pass.doubles.json
|
78
|
+
- spec/fixtures/pass.empty_array.json
|
79
|
+
- spec/fixtures/pass.empty_string.json
|
80
|
+
- spec/fixtures/pass.escaped_bulgarian.json
|
81
|
+
- spec/fixtures/pass.escaped_foobar.json
|
82
|
+
- spec/fixtures/pass.item.json
|
83
|
+
- spec/fixtures/pass.json-org-sample1.json
|
84
|
+
- spec/fixtures/pass.json-org-sample2.json
|
85
|
+
- spec/fixtures/pass.json-org-sample3.json
|
86
|
+
- spec/fixtures/pass.json-org-sample4-nows.json
|
87
|
+
- spec/fixtures/pass.json-org-sample4.json
|
88
|
+
- spec/fixtures/pass.json-org-sample5.json
|
89
|
+
- spec/fixtures/pass.map-spain.xml.json
|
90
|
+
- spec/fixtures/pass.ns-invoice100.xml.json
|
91
|
+
- spec/fixtures/pass.ns-soap.xml.json
|
92
|
+
- spec/fixtures/pass.numbers-fp-4k.json
|
93
|
+
- spec/fixtures/pass.numbers-fp-64k.json
|
94
|
+
- spec/fixtures/pass.numbers-int-4k.json
|
95
|
+
- spec/fixtures/pass.numbers-int-64k.json
|
96
|
+
- spec/fixtures/pass.twitter-search.json
|
97
|
+
- spec/fixtures/pass.twitter-search2.json
|
98
|
+
- spec/fixtures/pass.unicode.json
|
99
|
+
- spec/fixtures/pass.yelp.json
|
100
|
+
- spec/fixtures/pass1.json
|
101
|
+
- spec/fixtures/pass2.json
|
102
|
+
- spec/fixtures/pass3.json
|
103
|
+
- spec/fixtures_spec.rb
|
104
|
+
- spec/one_off_spec.rb
|
105
|
+
- spec/spec_helper.rb
|
106
106
|
- yajl-ruby.gemspec
|
107
107
|
has_rdoc: true
|
108
108
|
homepage: http://github.com/brianmario/yajl-ruby
|
@@ -131,5 +131,8 @@ rubygems_version: 1.2.0
|
|
131
131
|
signing_key:
|
132
132
|
specification_version: 3
|
133
133
|
summary: Ruby C bindings to the excellent Yajl JSON stream-based parser library.
|
134
|
-
test_files:
|
135
|
-
|
134
|
+
test_files:
|
135
|
+
- spec/active_support_spec.rb
|
136
|
+
- spec/fixtures_spec.rb
|
137
|
+
- spec/one_off_spec.rb
|
138
|
+
- spec/spec_helper.rb
|