Commit a0e14657f088686c88a01e149a4a0bb1760eb37d

Authored by Cyril Mougel
1 parent 17cfce31
Exists in master and in 1 other branch production

Update some gem in their patch-level version

Use Nokogiri to parse XML and see if it's valid XML
@@ -8,9 +8,6 @@ gem 'haml' @@ -8,9 +8,6 @@ gem 'haml'
8 gem 'htmlentities', "~> 4.3.0" 8 gem 'htmlentities', "~> 4.3.0"
9 gem 'rack-ssl', :require => 'rack/ssl' # force SSL 9 gem 'rack-ssl', :require => 'rack/ssl' # force SSL
10 10
11 -# Remove this when tilt 1.3.7 is released.  
12 -gem 'tilt', :git => 'https://github.com/rtomayko/tilt.git'  
13 -  
14 gem 'useragent', '~> 0.4.16' 11 gem 'useragent', '~> 0.4.16'
15 gem 'inherited_resources' 12 gem 'inherited_resources'
16 gem 'SystemTimer', :platform => :ruby_18 13 gem 'SystemTimer', :platform => :ruby_18
@@ -5,12 +5,6 @@ GIT @@ -5,12 +5,6 @@ GIT
5 gitlab (2.2.0) 5 gitlab (2.2.0)
6 httparty 6 httparty
7 7
8 -GIT  
9 - remote: https://github.com/rtomayko/tilt.git  
10 - revision: 74618967fbed3e206453516b92b47cd9aa922903  
11 - specs:  
12 - tilt (1.4.0)  
13 -  
14 GEM 8 GEM
15 remote: http://rubygems.org/ 9 remote: http://rubygems.org/
16 specs: 10 specs:
@@ -46,32 +40,33 @@ GEM @@ -46,32 +40,33 @@ GEM
46 activesupport (3.2.13) 40 activesupport (3.2.13)
47 i18n (= 0.6.1) 41 i18n (= 0.6.1)
48 multi_json (~> 1.0) 42 multi_json (~> 1.0)
49 - addressable (2.3.2) 43 + addressable (2.3.4)
50 airbrake (3.1.12) 44 airbrake (3.1.12)
51 activesupport 45 activesupport
52 builder 46 builder
53 json 47 json
54 arel (3.0.2) 48 arel (3.0.2)
55 bcrypt-ruby (3.0.1) 49 bcrypt-ruby (3.0.1)
56 - better_errors (0.7.0) 50 + better_errors (0.8.0)
57 coderay (>= 1.0.0) 51 coderay (>= 1.0.0)
58 erubis (>= 2.6.6) 52 erubis (>= 2.6.6)
59 binding_of_caller (0.7.1) 53 binding_of_caller (0.7.1)
60 debug_inspector (>= 0.0.1) 54 debug_inspector (>= 0.0.1)
61 - bitbucket_rest_api (0.1.1) 55 + bitbucket_rest_api (0.1.2)
62 faraday (~> 0.8.1) 56 faraday (~> 0.8.1)
63 faraday_middleware (~> 0.8.1) 57 faraday_middleware (~> 0.8.1)
64 hashie (~> 1.2.0) 58 hashie (~> 1.2.0)
65 multi_json (~> 1.3) 59 multi_json (~> 1.3)
66 nokogiri (~> 1.5.2) 60 nokogiri (~> 1.5.2)
67 simple_oauth 61 simple_oauth
68 - bson (1.8.5)  
69 - bson_ext (1.8.5)  
70 - bson (~> 1.8.5) 62 + bson (1.8.6)
  63 + bson_ext (1.8.6)
  64 + bson (~> 1.8.6)
71 builder (3.0.4) 65 builder (3.0.4)
  66 + callsite (0.0.11)
72 campy (0.1.3) 67 campy (0.1.3)
73 multi_json (~> 1.0) 68 multi_json (~> 1.0)
74 - capistrano (2.13.5) 69 + capistrano (2.15.4)
75 highline 70 highline
76 net-scp (>= 1.0.0) 71 net-scp (>= 1.0.0)
77 net-sftp (>= 2.0.0) 72 net-sftp (>= 2.0.0)
@@ -86,12 +81,12 @@ GEM @@ -86,12 +81,12 @@ GEM
86 xpath (~> 0.1.4) 81 xpath (~> 0.1.4)
87 childprocess (0.3.5) 82 childprocess (0.3.5)
88 ffi (~> 1.0, >= 1.0.6) 83 ffi (~> 1.0, >= 1.0.6)
89 - coderay (1.0.6) 84 + coderay (1.0.9)
90 colorize (0.5.8) 85 colorize (0.5.8)
91 columnize (0.3.6) 86 columnize (0.3.6)
92 - coveralls (0.5.7) 87 + coveralls (0.6.7)
93 colorize 88 colorize
94 - json 89 + multi_json (~> 1.3)
95 rest-client 90 rest-client
96 simplecov (>= 0.7) 91 simplecov (>= 0.7)
97 thor 92 thor
@@ -99,42 +94,43 @@ GEM @@ -99,42 +94,43 @@ GEM
99 css_parser (1.2.6) 94 css_parser (1.2.6)
100 addressable 95 addressable
101 rdoc 96 rdoc
102 - daemons (1.1.8) 97 + daemons (1.1.9)
103 database_cleaner (0.6.7) 98 database_cleaner (0.6.7)
104 debug_inspector (0.0.2) 99 debug_inspector (0.0.2)
105 - debugger (1.3.0) 100 + debugger (1.6.0)
106 columnize (>= 0.3.1) 101 columnize (>= 0.3.1)
107 - debugger-linecache (~> 1.1.1)  
108 - debugger-ruby_core_source (~> 1.1.7)  
109 - debugger-linecache (1.1.2)  
110 - debugger-ruby_core_source (>= 1.1.1)  
111 - debugger-ruby_core_source (1.1.7) 102 + debugger-linecache (~> 1.2.0)
  103 + debugger-ruby_core_source (~> 1.2.1)
  104 + debugger-linecache (1.2.0)
  105 + debugger-ruby_core_source (1.2.2)
112 devise (1.5.4) 106 devise (1.5.4)
113 bcrypt-ruby (~> 3.0) 107 bcrypt-ruby (~> 3.0)
114 orm_adapter (~> 0.0.3) 108 orm_adapter (~> 0.0.3)
115 warden (~> 1.1) 109 warden (~> 1.1)
116 diff-lcs (1.2.4) 110 diff-lcs (1.2.4)
117 - email_spec (1.2.1) 111 + dotenv (0.7.0)
  112 + email_spec (1.4.0)
  113 + launchy (~> 2.1)
118 mail (~> 2.2) 114 mail (~> 2.2)
119 - rspec (~> 2.0)  
120 erubis (2.7.0) 115 erubis (2.7.0)
121 eventmachine (1.0.3) 116 eventmachine (1.0.3)
122 execjs (1.4.0) 117 execjs (1.4.0)
123 multi_json (~> 1.0) 118 multi_json (~> 1.0)
124 fabrication (1.3.2) 119 fabrication (1.3.2)
125 - faraday (0.8.4) 120 + faraday (0.8.7)
126 multipart-post (~> 1.1) 121 multipart-post (~> 1.1)
127 faraday_middleware (0.8.8) 122 faraday_middleware (0.8.8)
128 faraday (>= 0.7.4, < 0.9) 123 faraday (>= 0.7.4, < 0.9)
129 ffi (1.1.4) 124 ffi (1.1.4)
130 - foreman (0.60.2) 125 + foreman (0.63.0)
  126 + dotenv (>= 0.7)
131 thor (>= 0.13.6) 127 thor (>= 0.13.6)
132 haml (3.1.7) 128 haml (3.1.7)
133 happymapper (0.4.0) 129 happymapper (0.4.0)
134 libxml-ruby (~> 2.0) 130 libxml-ruby (~> 2.0)
135 has_scope (0.5.1) 131 has_scope (0.5.1)
136 hashie (1.2.0) 132 hashie (1.2.0)
137 - highline (1.6.15) 133 + highline (1.6.19)
138 hike (1.2.2) 134 hike (1.2.2)
139 hipchat (0.4.1) 135 hipchat (0.4.1)
140 httparty 136 httparty
@@ -154,35 +150,35 @@ GEM @@ -154,35 +150,35 @@ GEM
154 has_scope (~> 0.5.0) 150 has_scope (~> 0.5.0)
155 responders (~> 0.6) 151 responders (~> 0.6)
156 journey (1.0.4) 152 journey (1.0.4)
157 - json (1.7.7) 153 + json (1.8.0)
158 jwt (0.1.5) 154 jwt (0.1.5)
159 multi_json (>= 1.0) 155 multi_json (>= 1.0)
160 kaminari (0.14.1) 156 kaminari (0.14.1)
161 actionpack (>= 3.0.0) 157 actionpack (>= 3.0.0)
162 activesupport (>= 3.0.0) 158 activesupport (>= 3.0.0)
163 kgio (2.7.4) 159 kgio (2.7.4)
164 - launchy (2.1.2) 160 + launchy (2.3.0)
165 addressable (~> 2.3) 161 addressable (~> 2.3)
166 - libv8 (3.11.8.13) 162 + libv8 (3.11.8.17)
167 libwebsocket (0.1.5) 163 libwebsocket (0.1.5)
168 addressable 164 addressable
169 - libxml-ruby (2.3.3) 165 + libxml-ruby (2.6.0)
170 lighthouse-api (2.0) 166 lighthouse-api (2.0)
171 activeresource (>= 3.0.0) 167 activeresource (>= 3.0.0)
172 activesupport (>= 3.0.0) 168 activesupport (>= 3.0.0)
173 linecache (0.46) 169 linecache (0.46)
174 rbx-require-relative (> 0.0.4) 170 rbx-require-relative (> 0.0.4)
175 - mail (2.5.3)  
176 - i18n (>= 0.4.0) 171 + mail (2.5.4)
177 mime-types (~> 1.16) 172 mime-types (~> 1.16)
178 treetop (~> 1.4.8) 173 treetop (~> 1.4.8)
179 - meta_request (0.2.2) 174 + meta_request (0.2.5)
  175 + callsite
180 rack-contrib 176 rack-contrib
181 railties 177 railties
182 - method_source (0.7.1)  
183 - mime-types (1.21)  
184 - mongo (1.8.5)  
185 - bson (~> 1.8.5) 178 + method_source (0.8.1)
  179 + mime-types (1.23)
  180 + mongo (1.8.6)
  181 + bson (~> 1.8.6)
186 mongoid (2.7.1) 182 mongoid (2.7.1)
187 activemodel (~> 3.1) 183 activemodel (~> 3.1)
188 mongo (~> 1.8) 184 mongo (~> 1.8)
@@ -193,16 +189,18 @@ GEM @@ -193,16 +189,18 @@ GEM
193 rails (>= 3.0.0) 189 rails (>= 3.0.0)
194 railties (>= 3.0.0) 190 railties (>= 3.0.0)
195 multi_json (1.7.3) 191 multi_json (1.7.3)
196 - multi_xml (0.5.2)  
197 - multipart-post (1.1.5)  
198 - net-scp (1.0.4)  
199 - net-ssh (>= 1.99.1)  
200 - net-sftp (2.0.5)  
201 - net-ssh (>= 2.0.9)  
202 - net-ssh (2.6.1)  
203 - net-ssh-gateway (1.1.0)  
204 - net-ssh (>= 1.99.1)  
205 - nokogiri (1.5.5) 192 + multi_xml (0.5.3)
  193 + multipart-post (1.2.0)
  194 + net-scp (1.1.1)
  195 + net-ssh (>= 2.6.5)
  196 + net-sftp (2.1.2)
  197 + net-ssh (>= 2.6.5)
  198 + net-ssh (2.6.7)
  199 + net-ssh-gateway (1.2.0)
  200 + net-ssh (>= 2.6.5)
  201 + nokogiri (1.5.9)
  202 + nokogiri-happymapper (0.5.7)
  203 + nokogiri (~> 1.5)
206 oauth2 (0.8.0) 204 oauth2 (0.8.0)
207 faraday (~> 0.8) 205 faraday (~> 0.8)
208 httpauth (~> 0.1) 206 httpauth (~> 0.1)
@@ -215,8 +213,8 @@ GEM @@ -215,8 +213,8 @@ GEM
215 faraday_middleware (~> 0.8) 213 faraday_middleware (~> 0.8)
216 hashie (~> 1.2) 214 hashie (~> 1.2)
217 multi_json (~> 1.3) 215 multi_json (~> 1.3)
218 - omniauth (1.1.1)  
219 - hashie (~> 1.2) 216 + omniauth (1.1.4)
  217 + hashie (>= 1.2, < 3)
220 rack 218 rack
221 omniauth-github (1.0.2) 219 omniauth-github (1.0.2)
222 omniauth (~> 1.0) 220 omniauth (~> 1.0)
@@ -227,25 +225,26 @@ GEM @@ -227,25 +225,26 @@ GEM
227 orm_adapter (0.0.7) 225 orm_adapter (0.0.7)
228 oruen_redmine_client (0.0.1) 226 oruen_redmine_client (0.0.1)
229 activeresource (>= 2.3.0) 227 activeresource (>= 2.3.0)
230 - pivotal-tracker (0.5.4)  
231 - builder 228 + pivotal-tracker (0.5.10)
232 builder 229 builder
233 - happymapper (>= 0.3.2) 230 + crack
234 happymapper (>= 0.3.2) 231 happymapper (>= 0.3.2)
235 nokogiri (>= 1.4.3) 232 nokogiri (>= 1.4.3)
236 - nokogiri (~> 1.4)  
237 - rest-client (~> 1.6.0) 233 + nokogiri (>= 1.5.5)
  234 + nokogiri-happymapper (>= 0.5.4)
238 rest-client (~> 1.6.0) 235 rest-client (~> 1.6.0)
239 polyglot (0.3.3) 236 polyglot (0.3.3)
240 premailer (1.7.3) 237 premailer (1.7.3)
241 css_parser (>= 1.1.9) 238 css_parser (>= 1.1.9)
242 htmlentities (>= 4.0.0) 239 htmlentities (>= 4.0.0)
243 - pry (0.9.9.6) 240 + pry (0.9.12.2)
244 coderay (~> 1.0.5) 241 coderay (~> 1.0.5)
245 - method_source (~> 0.7.1)  
246 - slop (>= 2.4.4, < 3)  
247 - pry-rails (0.2.0)  
248 - pry 242 + method_source (~> 0.8)
  243 + slop (~> 3.4)
  244 + pry-rails (0.3.0)
  245 + pry (>= 0.9.10)
  246 + puma (2.0.1)
  247 + rack (>= 1.1, < 2.0)
249 rack (1.4.5) 248 rack (1.4.5)
250 rack-cache (1.2) 249 rack-cache (1.2)
251 rack (>= 0.4) 250 rack (>= 0.4)
@@ -253,7 +252,7 @@ GEM @@ -253,7 +252,7 @@ GEM
253 rack (>= 0.9.1) 252 rack (>= 0.9.1)
254 rack-ssl (1.3.3) 253 rack-ssl (1.3.3)
255 rack 254 rack
256 - rack-ssl-enforcer (0.2.4) 255 + rack-ssl-enforcer (0.2.5)
257 rack-test (0.6.2) 256 rack-test (0.6.2)
258 rack (>= 1.0) 257 rack (>= 1.0)
259 rails (3.2.13) 258 rails (3.2.13)
@@ -278,21 +277,17 @@ GEM @@ -278,21 +277,17 @@ GEM
278 rbx-require-relative (0.0.9) 277 rbx-require-relative (0.0.9)
279 rdoc (3.12.2) 278 rdoc (3.12.2)
280 json (~> 1.4) 279 json (~> 1.4)
281 - ref (1.0.2) 280 + ref (1.0.4)
282 responders (0.9.2) 281 responders (0.9.2)
283 railties (~> 3.1) 282 railties (~> 3.1)
284 rest-client (1.6.7) 283 rest-client (1.6.7)
285 mime-types (>= 1.16) 284 mime-types (>= 1.16)
286 ri_cal (0.8.8) 285 ri_cal (0.8.8)
287 - rspec (2.13.0)  
288 - rspec-core (~> 2.13.0)  
289 - rspec-expectations (~> 2.13.0)  
290 - rspec-mocks (~> 2.13.0)  
291 rspec-core (2.13.1) 286 rspec-core (2.13.1)
292 rspec-expectations (2.13.0) 287 rspec-expectations (2.13.0)
293 diff-lcs (>= 1.1.3, < 2.0) 288 diff-lcs (>= 1.1.3, < 2.0)
294 rspec-mocks (2.13.1) 289 rspec-mocks (2.13.1)
295 - rspec-rails (2.13.1) 290 + rspec-rails (2.13.2)
296 actionpack (>= 3.0) 291 actionpack (>= 3.0)
297 activesupport (>= 3.0) 292 activesupport (>= 3.0)
298 railties (>= 3.0) 293 railties (>= 3.0)
@@ -315,12 +310,12 @@ GEM @@ -315,12 +310,12 @@ GEM
315 libwebsocket (~> 0.1.3) 310 libwebsocket (~> 0.1.3)
316 multi_json (~> 1.0) 311 multi_json (~> 1.0)
317 rubyzip 312 rubyzip
318 - simple_oauth (0.1.9) 313 + simple_oauth (0.2.0)
319 simplecov (0.7.1) 314 simplecov (0.7.1)
320 multi_json (~> 1.0) 315 multi_json (~> 1.0)
321 simplecov-html (~> 0.7.1) 316 simplecov-html (~> 0.7.1)
322 simplecov-html (0.7.1) 317 simplecov-html (0.7.1)
323 - slop (2.4.4) 318 + slop (3.4.5)
324 sprockets (2.2.2) 319 sprockets (2.2.2)
325 hike (~> 1.2) 320 hike (~> 1.2)
326 multi_json (~> 1.0) 321 multi_json (~> 1.0)
@@ -329,12 +324,13 @@ GEM @@ -329,12 +324,13 @@ GEM
329 therubyracer (0.11.4) 324 therubyracer (0.11.4)
330 libv8 (~> 3.11.8.12) 325 libv8 (~> 3.11.8.12)
331 ref 326 ref
332 - thin (1.4.1) 327 + thin (1.5.1)
333 daemons (>= 1.0.9) 328 daemons (>= 1.0.9)
334 eventmachine (>= 0.12.6) 329 eventmachine (>= 0.12.6)
335 rack (>= 1.0.0) 330 rack (>= 1.0.0)
336 thor (0.18.1) 331 thor (0.18.1)
337 - timecop (0.3.5) 332 + tilt (1.4.1)
  333 + timecop (0.6.1)
338 treetop (1.4.12) 334 treetop (1.4.12)
339 polyglot 335 polyglot
340 polyglot (>= 0.3.1) 336 polyglot (>= 0.3.1)
@@ -353,9 +349,9 @@ GEM @@ -353,9 +349,9 @@ GEM
353 useragent (0.4.16) 349 useragent (0.4.16)
354 warden (1.2.1) 350 warden (1.2.1)
355 rack (>= 1.0) 351 rack (>= 1.0)
356 - webmock (1.8.7) 352 + webmock (1.11.0)
357 addressable (>= 2.2.7) 353 addressable (>= 2.2.7)
358 - crack (>= 0.1.7) 354 + crack (>= 0.3.2)
359 xmpp4r (0.5) 355 xmpp4r (0.5)
360 xpath (0.1.4) 356 xpath (0.1.4)
361 nokogiri (~> 1.3) 357 nokogiri (~> 1.3)
@@ -415,7 +411,6 @@ DEPENDENCIES @@ -415,7 +411,6 @@ DEPENDENCIES
415 rushover 411 rushover
416 therubyracer 412 therubyracer
417 thin 413 thin
418 - tilt!  
419 timecop 414 timecop
420 turbo-sprockets-rails3 415 turbo-sprockets-rails3
421 uglifier (>= 1.0.3) 416 uglifier (>= 1.0.3)
app/controllers/api/v1/notices_controller.rb
1 class Api::V1::NoticesController < ApplicationController 1 class Api::V1::NoticesController < ApplicationController
2 respond_to :json, :xml 2 respond_to :json, :xml
3 - 3 +
4 def index 4 def index
5 query = {} 5 query = {}
6 fields = %w{created_at message error_class} 6 fields = %w{created_at message error_class}
7 - 7 +
8 if params.key?(:start_date) && params.key?(:end_date) 8 if params.key?(:start_date) && params.key?(:end_date)
9 start_date = Time.parse(params[:start_date]).utc 9 start_date = Time.parse(params[:start_date]).utc
10 end_date = Time.parse(params[:end_date]).utc 10 end_date = Time.parse(params[:end_date]).utc
11 query = {:created_at => {"$lte" => end_date, "$gte" => start_date}} 11 query = {:created_at => {"$lte" => end_date, "$gte" => start_date}}
12 end 12 end
13 - 13 +
14 results = benchmark("[api/v1/notices_controller] query time") { Mongoid.master["notices"].find(query, :fields => fields).to_a } 14 results = benchmark("[api/v1/notices_controller] query time") { Mongoid.master["notices"].find(query, :fields => fields).to_a }
15 - 15 +
16 respond_to do |format| 16 respond_to do |format|
17 format.html { render :json => Yajl.dump(results) } # render JSON if no extension specified on path 17 format.html { render :json => Yajl.dump(results) } # render JSON if no extension specified on path
18 format.json { render :json => Yajl.dump(results) } 18 format.json { render :json => Yajl.dump(results) }
19 format.xml { render :xml => results } 19 format.xml { render :xml => results }
20 end 20 end
21 end 21 end
22 - 22 +
23 end 23 end
spec/controllers/api/v1/notices_controller_spec.rb
@@ -22,7 +22,7 @@ describe Api::V1::NoticesController do @@ -22,7 +22,7 @@ describe Api::V1::NoticesController do
22 22
23 it "should return XML if XML is requested" do 23 it "should return XML if XML is requested" do
24 get :index, :auth_token => @user.authentication_token, :format => "xml" 24 get :index, :auth_token => @user.authentication_token, :format => "xml"
25 - lambda { XML::Parser.string(response.body).parse }.should_not raise_error 25 + Nokogiri::XML(response.body).errors.should be_empty
26 end 26 end
27 27
28 it "should return JSON by default" do 28 it "should return JSON by default" do
spec/controllers/api/v1/problems_controller_spec.rb
@@ -24,7 +24,7 @@ describe Api::V1::ProblemsController do @@ -24,7 +24,7 @@ describe Api::V1::ProblemsController do
24 24
25 it "should return XML if XML is requested" do 25 it "should return XML if XML is requested" do
26 get :index, :auth_token => @user.authentication_token, :format => "xml" 26 get :index, :auth_token => @user.authentication_token, :format => "xml"
27 - lambda { XML::Parser.string(response.body).parse }.should_not raise_error 27 + Nokogiri::XML(response.body).errors.should be_empty
28 end 28 end
29 29
30 it "should return JSON by default" do 30 it "should return JSON by default" do