brianmario-yajl-ruby 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/CHANGELOG.rdoc +5 -0
  2. data/VERSION.yml +1 -1
  3. data/lib/yajl/http_stream.rb +5 -3
  4. data/{specs → spec}/active_support_spec.rb +0 -0
  5. data/{specs → spec}/fixtures/fail.15.json +0 -0
  6. data/{specs → spec}/fixtures/fail.16.json +0 -0
  7. data/{specs → spec}/fixtures/fail.17.json +0 -0
  8. data/{specs → spec}/fixtures/fail.26.json +0 -0
  9. data/{specs → spec}/fixtures/fail11.json +0 -0
  10. data/{specs → spec}/fixtures/fail12.json +0 -0
  11. data/{specs → spec}/fixtures/fail13.json +0 -0
  12. data/{specs → spec}/fixtures/fail14.json +0 -0
  13. data/{specs → spec}/fixtures/fail19.json +0 -0
  14. data/{specs → spec}/fixtures/fail20.json +0 -0
  15. data/{specs → spec}/fixtures/fail21.json +0 -0
  16. data/{specs → spec}/fixtures/fail22.json +0 -0
  17. data/{specs → spec}/fixtures/fail23.json +0 -0
  18. data/{specs → spec}/fixtures/fail24.json +0 -0
  19. data/{specs → spec}/fixtures/fail25.json +0 -0
  20. data/{specs → spec}/fixtures/fail27.json +0 -0
  21. data/{specs → spec}/fixtures/fail28.json +0 -0
  22. data/{specs → spec}/fixtures/fail3.json +0 -0
  23. data/{specs → spec}/fixtures/fail4.json +0 -0
  24. data/{specs → spec}/fixtures/fail5.json +0 -0
  25. data/{specs → spec}/fixtures/fail6.json +0 -0
  26. data/{specs → spec}/fixtures/fail9.json +0 -0
  27. data/{specs → spec}/fixtures/pass.array.json +0 -0
  28. data/{specs → spec}/fixtures/pass.codepoints_from_unicode_org.json +0 -0
  29. data/{specs → spec}/fixtures/pass.contacts.json +0 -0
  30. data/{specs → spec}/fixtures/pass.db100.xml.json +0 -0
  31. data/{specs → spec}/fixtures/pass.db1000.xml.json +0 -0
  32. data/{specs → spec}/fixtures/pass.dc_simple_with_comments.json +0 -0
  33. data/{specs → spec}/fixtures/pass.deep_arrays.json +0 -0
  34. data/{specs → spec}/fixtures/pass.difficult_json_c_test_case.json +0 -0
  35. data/{specs → spec}/fixtures/pass.difficult_json_c_test_case_with_comments.json +0 -0
  36. data/{specs → spec}/fixtures/pass.doubles.json +0 -0
  37. data/{specs → spec}/fixtures/pass.empty_array.json +0 -0
  38. data/{specs → spec}/fixtures/pass.empty_string.json +0 -0
  39. data/{specs → spec}/fixtures/pass.escaped_bulgarian.json +0 -0
  40. data/{specs → spec}/fixtures/pass.escaped_foobar.json +0 -0
  41. data/{specs → spec}/fixtures/pass.item.json +0 -0
  42. data/{specs → spec}/fixtures/pass.json-org-sample1.json +0 -0
  43. data/{specs → spec}/fixtures/pass.json-org-sample2.json +0 -0
  44. data/{specs → spec}/fixtures/pass.json-org-sample3.json +0 -0
  45. data/{specs → spec}/fixtures/pass.json-org-sample4-nows.json +0 -0
  46. data/{specs → spec}/fixtures/pass.json-org-sample4.json +0 -0
  47. data/{specs → spec}/fixtures/pass.json-org-sample5.json +0 -0
  48. data/{specs → spec}/fixtures/pass.map-spain.xml.json +0 -0
  49. data/{specs → spec}/fixtures/pass.ns-invoice100.xml.json +0 -0
  50. data/{specs → spec}/fixtures/pass.ns-soap.xml.json +0 -0
  51. data/{specs → spec}/fixtures/pass.numbers-fp-4k.json +0 -0
  52. data/{specs → spec}/fixtures/pass.numbers-fp-64k.json +0 -0
  53. data/{specs → spec}/fixtures/pass.numbers-int-4k.json +0 -0
  54. data/{specs → spec}/fixtures/pass.numbers-int-64k.json +0 -0
  55. data/{specs → spec}/fixtures/pass.twitter-search.json +0 -0
  56. data/{specs → spec}/fixtures/pass.twitter-search2.json +0 -0
  57. data/{specs → spec}/fixtures/pass.unicode.json +0 -0
  58. data/{specs → spec}/fixtures/pass.yelp.json +0 -0
  59. data/{specs → spec}/fixtures/pass1.json +0 -0
  60. data/{specs → spec}/fixtures/pass2.json +0 -0
  61. data/{specs → spec}/fixtures/pass3.json +0 -0
  62. data/{specs → spec}/fixtures_spec.rb +0 -0
  63. data/{specs → spec}/one_off_spec.rb +0 -0
  64. data/{specs → spec}/spec_helper.rb +0 -0
  65. data/yajl-ruby.gemspec +69 -63
  66. 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
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 2
2
+ :patch: 3
3
3
  :major: 0
4
4
  :minor: 4
@@ -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
- MIME_TYPE = "application/json"
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
- if response_head[:headers]["Content-Type"].include?(MIME_TYPE)
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 #{response_head[:headers]["Content-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
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.2"
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-04-30}
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
- "specs/active_support_spec.rb",
37
- "specs/fixtures/fail.15.json",
38
- "specs/fixtures/fail.16.json",
39
- "specs/fixtures/fail.17.json",
40
- "specs/fixtures/fail.26.json",
41
- "specs/fixtures/fail11.json",
42
- "specs/fixtures/fail12.json",
43
- "specs/fixtures/fail13.json",
44
- "specs/fixtures/fail14.json",
45
- "specs/fixtures/fail19.json",
46
- "specs/fixtures/fail20.json",
47
- "specs/fixtures/fail21.json",
48
- "specs/fixtures/fail22.json",
49
- "specs/fixtures/fail23.json",
50
- "specs/fixtures/fail24.json",
51
- "specs/fixtures/fail25.json",
52
- "specs/fixtures/fail27.json",
53
- "specs/fixtures/fail28.json",
54
- "specs/fixtures/fail3.json",
55
- "specs/fixtures/fail4.json",
56
- "specs/fixtures/fail5.json",
57
- "specs/fixtures/fail6.json",
58
- "specs/fixtures/fail9.json",
59
- "specs/fixtures/pass.array.json",
60
- "specs/fixtures/pass.codepoints_from_unicode_org.json",
61
- "specs/fixtures/pass.contacts.json",
62
- "specs/fixtures/pass.db100.xml.json",
63
- "specs/fixtures/pass.db1000.xml.json",
64
- "specs/fixtures/pass.dc_simple_with_comments.json",
65
- "specs/fixtures/pass.deep_arrays.json",
66
- "specs/fixtures/pass.difficult_json_c_test_case.json",
67
- "specs/fixtures/pass.difficult_json_c_test_case_with_comments.json",
68
- "specs/fixtures/pass.doubles.json",
69
- "specs/fixtures/pass.empty_array.json",
70
- "specs/fixtures/pass.empty_string.json",
71
- "specs/fixtures/pass.escaped_bulgarian.json",
72
- "specs/fixtures/pass.escaped_foobar.json",
73
- "specs/fixtures/pass.item.json",
74
- "specs/fixtures/pass.json-org-sample1.json",
75
- "specs/fixtures/pass.json-org-sample2.json",
76
- "specs/fixtures/pass.json-org-sample3.json",
77
- "specs/fixtures/pass.json-org-sample4-nows.json",
78
- "specs/fixtures/pass.json-org-sample4.json",
79
- "specs/fixtures/pass.json-org-sample5.json",
80
- "specs/fixtures/pass.map-spain.xml.json",
81
- "specs/fixtures/pass.ns-invoice100.xml.json",
82
- "specs/fixtures/pass.ns-soap.xml.json",
83
- "specs/fixtures/pass.numbers-fp-4k.json",
84
- "specs/fixtures/pass.numbers-fp-64k.json",
85
- "specs/fixtures/pass.numbers-int-4k.json",
86
- "specs/fixtures/pass.numbers-int-64k.json",
87
- "specs/fixtures/pass.twitter-search.json",
88
- "specs/fixtures/pass.twitter-search2.json",
89
- "specs/fixtures/pass.unicode.json",
90
- "specs/fixtures/pass.yelp.json",
91
- "specs/fixtures/pass1.json",
92
- "specs/fixtures/pass2.json",
93
- "specs/fixtures/pass3.json",
94
- "specs/fixtures_spec.rb",
95
- "specs/one_off_spec.rb",
96
- "specs/spec_helper.rb",
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.2
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-04-30 00:00:00 -07:00
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
- - specs/active_support_spec.rb
46
- - specs/fixtures/fail.15.json
47
- - specs/fixtures/fail.16.json
48
- - specs/fixtures/fail.17.json
49
- - specs/fixtures/fail.26.json
50
- - specs/fixtures/fail11.json
51
- - specs/fixtures/fail12.json
52
- - specs/fixtures/fail13.json
53
- - specs/fixtures/fail14.json
54
- - specs/fixtures/fail19.json
55
- - specs/fixtures/fail20.json
56
- - specs/fixtures/fail21.json
57
- - specs/fixtures/fail22.json
58
- - specs/fixtures/fail23.json
59
- - specs/fixtures/fail24.json
60
- - specs/fixtures/fail25.json
61
- - specs/fixtures/fail27.json
62
- - specs/fixtures/fail28.json
63
- - specs/fixtures/fail3.json
64
- - specs/fixtures/fail4.json
65
- - specs/fixtures/fail5.json
66
- - specs/fixtures/fail6.json
67
- - specs/fixtures/fail9.json
68
- - specs/fixtures/pass.array.json
69
- - specs/fixtures/pass.codepoints_from_unicode_org.json
70
- - specs/fixtures/pass.contacts.json
71
- - specs/fixtures/pass.db100.xml.json
72
- - specs/fixtures/pass.db1000.xml.json
73
- - specs/fixtures/pass.dc_simple_with_comments.json
74
- - specs/fixtures/pass.deep_arrays.json
75
- - specs/fixtures/pass.difficult_json_c_test_case.json
76
- - specs/fixtures/pass.difficult_json_c_test_case_with_comments.json
77
- - specs/fixtures/pass.doubles.json
78
- - specs/fixtures/pass.empty_array.json
79
- - specs/fixtures/pass.empty_string.json
80
- - specs/fixtures/pass.escaped_bulgarian.json
81
- - specs/fixtures/pass.escaped_foobar.json
82
- - specs/fixtures/pass.item.json
83
- - specs/fixtures/pass.json-org-sample1.json
84
- - specs/fixtures/pass.json-org-sample2.json
85
- - specs/fixtures/pass.json-org-sample3.json
86
- - specs/fixtures/pass.json-org-sample4-nows.json
87
- - specs/fixtures/pass.json-org-sample4.json
88
- - specs/fixtures/pass.json-org-sample5.json
89
- - specs/fixtures/pass.map-spain.xml.json
90
- - specs/fixtures/pass.ns-invoice100.xml.json
91
- - specs/fixtures/pass.ns-soap.xml.json
92
- - specs/fixtures/pass.numbers-fp-4k.json
93
- - specs/fixtures/pass.numbers-fp-64k.json
94
- - specs/fixtures/pass.numbers-int-4k.json
95
- - specs/fixtures/pass.numbers-int-64k.json
96
- - specs/fixtures/pass.twitter-search.json
97
- - specs/fixtures/pass.twitter-search2.json
98
- - specs/fixtures/pass.unicode.json
99
- - specs/fixtures/pass.yelp.json
100
- - specs/fixtures/pass1.json
101
- - specs/fixtures/pass2.json
102
- - specs/fixtures/pass3.json
103
- - specs/fixtures_spec.rb
104
- - specs/one_off_spec.rb
105
- - specs/spec_helper.rb
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