OSDN Git Service

Merge branch 'gist' of https://github.com/Andrew8xx8/gitlabhq into Andrew8xx8-gist
[wvm/gitlab.git] / config / routes.rb
index 3609ac0..c802c60 100644 (file)
@@ -39,6 +39,16 @@ Gitlab::Application.routes.draw do
   get 'help/workflow'       => 'help#workflow'
 
   #
+  # Global snippets
+  #
+  resources :snippets do
+    member do
+      get "raw"
+    end
+  end
+  get "/s/:username" => "snippets#user_index", as: :user_snippets, constraints: { username: /.*/ }
+
+  #
   # Public namespace
   #
   namespace :public do
@@ -182,6 +192,14 @@ Gitlab::Application.routes.draw do
     resources :graph,   only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
     match "/compare/:from...:to" => "compare#show", as: "compare", via: [:get, :post], constraints: {from: /.+/, to: /.+/}
 
+    scope module: :projects do
+      resources :snippets do
+        member do
+          get "raw"
+        end
+      end
+    end
+
     resources :wikis, only: [:show, :edit, :destroy, :create] do
       collection do
         get :pages
@@ -255,19 +273,12 @@ Gitlab::Application.routes.draw do
       end
     end
 
-    resources :snippets do
-      member do
-        get "raw"
-      end
-    end
-
     resources :hooks, only: [:index, :create, :destroy] do
       member do
         get :test
       end
     end
 
-
     resources :team, controller: 'team_members', only: [:index]
     resources :milestones, except: [:destroy]