committee 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a95773b1641d3b1c1c339b9b43a85c0e0ea9d96c
4
+ data.tar.gz: 2160b7d4e815bcfb7d954a4935a92e00c5f0c01d
5
+ SHA512:
6
+ metadata.gz: 0f0a8bdadd9bfb215918a92262701f37233278213c590328c7f9f45fc638c4183b1aa9ccf2f957fe7eb241d6e8ee273ad7b4e75988453a5cc7633f1bf1ac3bf8
7
+ data.tar.gz: 7c935196dfddfa71229c7fe7f2d62e1679709e2602de7c14c2077f309ec182a90b17cea254286e70b653808282e119d6e231ad7d5a90ab57d9b488a388d5a805
@@ -10,8 +10,11 @@ module Committee::Middleware
10
10
  status, headers, response = @app.call(env)
11
11
  request = Rack::Request.new(env)
12
12
  if link = @router.routes_request?(request, prefix: @prefix)
13
- str = response.reduce("") { |str, s| str << s }
14
- data = MultiJson.decode(str)
13
+ full_body = ""
14
+ response.each do |chunk|
15
+ full_body << chunk
16
+ end
17
+ data = MultiJson.decode(full_body)
15
18
  Committee::ResponseValidator.new(link).call(headers, data)
16
19
  end
17
20
  [status, headers, response]
@@ -19,7 +22,7 @@ module Committee::Middleware
19
22
  raise if @raise
20
23
  render_error(500, :invalid_response, $!.message)
21
24
  rescue MultiJson::LoadError
22
- raise Commitee::InvalidResponse if @raise
25
+ raise Committee::InvalidResponse if @raise
23
26
  render_error(500, :invalid_response, "Response wasn't valid JSON.")
24
27
  end
25
28
  end
@@ -43,7 +43,7 @@ describe Committee::Middleware::ResponseValidation do
43
43
 
44
44
  it "rescues JSON errors" do
45
45
  @app = new_rack_app("[{x:y}]", {}, raise: true)
46
- assert(Committee::InvalidResponse) do
46
+ assert_raises(Committee::InvalidResponse) do
47
47
  get "/apps"
48
48
  end
49
49
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: committee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
4
+ version: 1.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Brandur
@@ -10,56 +9,106 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-06-02 00:00:00.000000000 Z
12
+ date: 2014-06-13 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: json_schema
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ~>
18
+ - - "~>"
21
19
  - !ruby/object:Gem::Version
22
20
  version: '0.1'
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ~>
25
+ - - "~>"
29
26
  - !ruby/object:Gem::Version
30
27
  version: '0.1'
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: multi_json
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>'
32
+ - - ">"
37
33
  - !ruby/object:Gem::Version
38
34
  version: '0.0'
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>'
39
+ - - ">"
45
40
  - !ruby/object:Gem::Version
46
41
  version: '0.0'
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: rack
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>'
46
+ - - ">"
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0.0'
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>'
53
+ - - ">"
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: minitest
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 5.3.4
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: 5.3.4
70
+ - !ruby/object:Gem::Dependency
71
+ name: rack-test
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 0.6.2
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 0.6.2
84
+ - !ruby/object:Gem::Dependency
85
+ name: rake
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: 10.3.2
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: 10.3.2
98
+ - !ruby/object:Gem::Dependency
99
+ name: rr
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: 1.1.2
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: 1.1.2
63
112
  description:
64
113
  email:
65
114
  - brandur@mutelight.org
@@ -69,6 +118,8 @@ executables:
69
118
  extensions: []
70
119
  extra_rdoc_files: []
71
120
  files:
121
+ - bin/committee-stub
122
+ - lib/committee.rb
72
123
  - lib/committee/errors.rb
73
124
  - lib/committee/middleware/base.rb
74
125
  - lib/committee/middleware/request_validation.rb
@@ -80,7 +131,6 @@ files:
80
131
  - lib/committee/response_validator.rb
81
132
  - lib/committee/router.rb
82
133
  - lib/committee/test/methods.rb
83
- - lib/committee.rb
84
134
  - test/middleware/request_validation_test.rb
85
135
  - test/middleware/response_validation_test.rb
86
136
  - test/middleware/stub_test.rb
@@ -91,31 +141,29 @@ files:
91
141
  - test/router_test.rb
92
142
  - test/test/methods_test.rb
93
143
  - test/test_helper.rb
94
- - bin/committee-stub
95
- homepage: https://github.com/heroku/committee
144
+ homepage: https://github.com/interagent/committee
96
145
  licenses:
97
146
  - MIT
147
+ metadata: {}
98
148
  post_install_message:
99
149
  rdoc_options: []
100
150
  require_paths:
101
151
  - lib
102
152
  required_ruby_version: !ruby/object:Gem::Requirement
103
- none: false
104
153
  requirements:
105
- - - ! '>='
154
+ - - ">="
106
155
  - !ruby/object:Gem::Version
107
156
  version: '0'
108
157
  required_rubygems_version: !ruby/object:Gem::Requirement
109
- none: false
110
158
  requirements:
111
- - - ! '>='
159
+ - - ">="
112
160
  - !ruby/object:Gem::Version
113
161
  version: '0'
114
162
  requirements: []
115
163
  rubyforge_project:
116
- rubygems_version: 1.8.24
164
+ rubygems_version: 2.2.2
117
165
  signing_key:
118
- specification_version: 3
166
+ specification_version: 4
119
167
  summary: A collection of Rack middleware to support JSON Schema.
120
168
  test_files: []
121
169
  has_rdoc: