@@ -259,23 +259,23 @@ def require_login
259
259
url = url_for ( :controller => params [ :controller ] , :action => params [ :action ] , :id => params [ :id ] , :project_id => params [ :project_id ] )
260
260
end
261
261
respond_to do |format |
262
- format . html {
262
+ format . html do
263
263
if request . xhr?
264
264
head :unauthorized
265
265
else
266
266
redirect_to signin_path ( :back_url => url )
267
267
end
268
- }
269
- format . any ( :atom , :pdf , :csv ) {
268
+ end
269
+ format . any ( :atom , :pdf , :csv ) do
270
270
redirect_to signin_path ( :back_url => url )
271
- }
272
- format . api {
271
+ end
272
+ format . api do
273
273
if Setting . rest_api_enabled? && accept_api_auth?
274
274
head ( :unauthorized , 'WWW-Authenticate' => 'Basic realm="Redmine API"' )
275
275
else
276
276
head ( :forbidden )
277
277
end
278
- }
278
+ end
279
279
format . js { head :unauthorized , 'WWW-Authenticate' => 'Basic realm="Redmine API"' }
280
280
format . any { head :unauthorized }
281
281
end
@@ -562,9 +562,9 @@ def render_error(arg)
562
562
@status = arg [ :status ] || 500
563
563
564
564
respond_to do |format |
565
- format . html {
565
+ format . html do
566
566
render :template => 'common/error' , :layout => use_layout , :status => @status
567
- }
567
+ end
568
568
format . any { head @status }
569
569
end
570
570
end
@@ -675,13 +675,13 @@ def parse_qvalues(value)
675
675
tmp = [ ]
676
676
if value
677
677
parts = value . split ( /,\s */ )
678
- parts . each { |part |
678
+ parts . each do |part |
679
679
if m = %r{^([^\s ,]+?)(?:;\s *q=(\d +(?:\. \d +)?))?$} . match ( part )
680
680
val = m [ 1 ]
681
681
q = ( m [ 2 ] or 1 ) . to_f
682
682
tmp . push ( [ val , q ] )
683
683
end
684
- }
684
+ end
685
685
tmp = tmp . sort_by { |val , q | -q }
686
686
tmp . collect! { |val , q | val }
687
687
end
0 commit comments