[#345] remove unneeded constraint

This commit is contained in:
Alexander Machehin 2014-03-26 00:44:06 +06:00
parent 4adae8319b
commit 5a02ed077b
1 changed files with 37 additions and 39 deletions

View File

@ -357,45 +357,43 @@ Rosa::Application.routes.draw do
post '/sections' => 'projects#sections' post '/sections' => 'projects#sections'
delete '/remove_user' => 'projects#remove_user', as: :remove_user_project delete '/remove_user' => 'projects#remove_user', as: :remove_user_project
# constraints treeish: /[\w\-\.]+(\/[\w\-\.]+)?/ do # constraints treeish: /[\w\-\.]+(\/[\w\-\.]+)?/ do
constraints treeish: /[\w\-\.]+/ do constraints Rosa::Constraints::Treeish do
constraints Rosa::Constraints::Treeish do # Tree
# Tree get '/' => "git/trees#show", as: :project
get '/' => "git/trees#show", as: :project get '/tree/:treeish(/*path)' => "git/trees#show", as: :tree, format: false
get '/tree/:treeish(/*path)' => "git/trees#show", as: :tree, format: false # Tags
# Tags get '/tags' => "git/trees#tags", as: :tags
get '/tags' => "git/trees#tags", as: :tags # Branches
# Branches get '/branches' => "git/trees#branches", as: :branches
get '/branches' => "git/trees#branches", as: :branches get '/branches/:treeish' => "git/trees#branches", as: :branch
get '/branches/:treeish' => "git/trees#branches", as: :branch delete '/branches/:treeish' => "git/trees#destroy", as: :destroy_branch
delete '/branches/:treeish' => "git/trees#destroy", as: :destroy_branch put '/branches/:treeish' => "git/trees#restore_branch", as: :restore_branch
put '/branches/:treeish' => "git/trees#restore_branch", as: :restore_branch post '/branches' => "git/trees#create", as: :create_branch
post '/branches' => "git/trees#create", as: :create_branch # Commits
# Commits get '/commits/:treeish(/*path)' => "git/commits#index", as: :commits, format: false
get '/commits/:treeish(/*path)' => "git/commits#index", as: :commits, format: false get '/commit/:id(.:format)' => "git/commits#show", as: :commit
get '/commit/:id(.:format)' => "git/commits#show", as: :commit # Commit comments
# Commit comments post '/commit/:commit_id/comments(.:format)' => "comments#create", as: :project_commit_comments
post '/commit/:commit_id/comments(.:format)' => "comments#create", as: :project_commit_comments get '/commit/:commit_id/comments/:id(.:format)' => "comments#edit", as: :edit_project_commit_comment
get '/commit/:commit_id/comments/:id(.:format)' => "comments#edit", as: :edit_project_commit_comment put '/commit/:commit_id/comments/:id(.:format)' => "comments#update", as: :project_commit_comment
put '/commit/:commit_id/comments/:id(.:format)' => "comments#update", as: :project_commit_comment delete '/commit/:commit_id/comments/:id(.:format)' => "comments#destroy"
delete '/commit/:commit_id/comments/:id(.:format)' => "comments#destroy" get '/commit/:commit_id/add_line_comments(.:format)' => "comments#new_line", as: :new_line_commit_comment
get '/commit/:commit_id/add_line_comments(.:format)' => "comments#new_line", as: :new_line_commit_comment # Commit subscribes
# Commit subscribes post '/commit/:commit_id/subscribe' => "commit_subscribes#create", as: :subscribe_commit
post '/commit/:commit_id/subscribe' => "commit_subscribes#create", as: :subscribe_commit delete '/commit/:commit_id/unsubscribe' => "commit_subscribes#destroy", as: :unsubscribe_commit
delete '/commit/:commit_id/unsubscribe' => "commit_subscribes#destroy", as: :unsubscribe_commit # Editing files
# Editing files get '/edit/:treeish/*path' => "git/blobs#edit", as: :edit_blob, format: false
get '/edit/:treeish/*path' => "git/blobs#edit", as: :edit_blob, format: false put '/edit/:treeish/*path' => "git/blobs#update", format: false
put '/edit/:treeish/*path' => "git/blobs#update", format: false # Blobs
# Blobs get '/blob/:treeish/*path' => "git/blobs#show", as: :blob, format: false
get '/blob/:treeish/*path' => "git/blobs#show", as: :blob, format: false # Blame
# Blame get '/blame/:treeish/*path' => "git/blobs#blame", as: :blame, format: false
get '/blame/:treeish/*path' => "git/blobs#blame", as: :blame, format: false # Raw
# Raw get '/raw/:treeish/*path' => "git/blobs#raw", as: :raw, format: false
get '/raw/:treeish/*path' => "git/blobs#raw", as: :raw, format: false # Archive
# Archive get '/archive/:treeish.:format' => "git/trees#archive", as: :archive, format: /zip|tar\.gz/
get '/archive/:treeish.:format' => "git/trees#archive", as: :archive, format: /zip|tar\.gz/ # Git diff
# Git diff get '/diff/:diff' => "git/commits#diff", as: :diff, format: false, diff: /.*/
get '/diff/:diff' => "git/commits#diff", as: :diff, format: false, diff: /.*/
end
end end
end end
end end