Merge branch 'master' into simplify_controllers2

Conflicts:
	app/controllers/commits_controller.rb
	app/controllers/refs_controller.rb
This commit is contained in:
Cyril 2012-09-27 12:25:52 +02:00
commit e563e948bb
108 changed files with 1762 additions and 652 deletions

View file

@ -112,7 +112,7 @@ class Settings < Settingslogic
def backup_path
t = app['backup_path'] || "backups/"
t = /^\//.match(t) ? t : File.join(Rails.root + t)
t = /^\//.match(t) ? t : Rails.root .join(t)
t
end

View file

@ -8,3 +8,24 @@
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
# Mark "commits" as uncountable.
#
# Without this change, the routes
#
# resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
# resources :commits, only: [:show], constraints: {id: /.+/}
#
# would generate identical route helper methods (`project_commit_path`), resulting
# in one of them not getting a helper method at all.
#
# After this change, the helper methods are:
#
# project_commit_path(@project, @project.commit)
# # => "/gitlabhq/commit/bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a
#
# project_commits_path(@project, 'stable/README.md')
# # => "/gitlabhq/commits/stable/README.md"
ActiveSupport::Inflector.inflections do |inflect|
inflect.uncountable %w(commits)
end

View file

@ -3,3 +3,5 @@
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
Mime::Type.register_alias 'text/plain', :patch

View file

@ -122,38 +122,14 @@ Gitlab::Application.routes.draw do
end
member do
get "tree", constraints: { id: /[a-zA-Z.\/0-9_\-]+/ }
# tree viewer logs
get "logs_tree", constraints: { id: /[a-zA-Z.\/0-9_\-]+/ }
get "blob",
constraints: {
id: /[a-zA-Z.0-9\/_\-]+/,
path: /.*/
}
# tree viewer
get "tree/:path" => "refs#tree",
as: :tree_file,
constraints: {
id: /[a-zA-Z.0-9\/_\-]+/,
path: /.*/
}
# tree viewer
get "logs_tree/:path" => "refs#logs_tree",
as: :logs_file,
constraints: {
id: /[a-zA-Z.0-9\/_\-]+/,
path: /.*/
}
# blame
get "blame/:path" => "refs#blame",
as: :blame_file,
constraints: {
id: /[a-zA-Z.0-9\/_\-]+/,
path: /.*/
}
end
end
@ -182,27 +158,27 @@ Gitlab::Application.routes.draw do
get :test
end
end
resources :commits do
collection do
get :compare
end
member do
get :patch
end
end
resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
resources :commits, only: [:show], constraints: {id: /.+/}
resources :compare, only: [:index, :create]
resources :blame, only: [:show], constraints: {id: /.+/}
resources :blob, only: [:show], constraints: {id: /.+/}
resources :tree, only: [:show], constraints: {id: /.+/}
match "/compare/:from...:to" => "compare#show", as: "compare", constraints: {from: /.+/, to: /.+/}
resources :team, controller: 'team_members', only: [:index]
resources :team_members
resources :milestones
resources :labels, only: [:index]
resources :issues do
collection do
post :sort
post :bulk_update
get :search
end
end
resources :notes, only: [:index, :create, :destroy] do
collection do
post :preview