Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0a280158
Commit
0a280158
authored
Apr 15, 2016
by
Timothy Andrew
Committed by
Kamil Trzcinski
Apr 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eager load `lib/api`
- So that the server doesn't have to be restarted for every change in dev.
parent
5fc310b4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
141 additions
and
140 deletions
+141
-140
config/application.rb
config/application.rb
+2
-0
config/routes.rb
config/routes.rb
+0
-1
lib/api/api.rb
lib/api/api.rb
+1
-3
lib/api/api_guard.rb
lib/api/api_guard.rb
+137
-135
lib/ci/api/api.rb
lib/ci/api/api.rb
+1
-1
No files found.
config/application.rb
View file @
0a280158
...
...
@@ -79,6 +79,8 @@ module Gitlab
# This is needed for gitlab-shell
ENV
[
'GITLAB_PATH_OUTSIDE_HOOK'
]
=
ENV
[
'PATH'
]
config
.
eager_load_paths
+=
[
"
#{
Rails
.
root
}
/lib"
]
config
.
generators
do
|
g
|
g
.
factory_girl
false
end
...
...
config/routes.rb
View file @
0a280158
require
'sidekiq/web'
require
'sidekiq/cron/web'
require
'api/api'
Rails
.
application
.
routes
.
draw
do
if
Gitlab
::
Sherlock
.
enabled?
...
...
lib/api/api.rb
View file @
0a280158
Dir
[
"
#{
Rails
.
root
}
/lib/api/*.rb"
].
each
{
|
file
|
require
file
}
module
API
class
API
<
Grape
::
API
include
APIGuard
include
::
API
::
APIGuard
version
'v3'
,
using: :path
rescue_from
ActiveRecord
::
RecordNotFound
do
...
...
lib/api/api_guard.rb
View file @
0a280158
...
...
@@ -2,7 +2,8 @@
require
'rack/oauth2'
module
APIGuard
module
API
module
APIGuard
extend
ActiveSupport
::
Concern
included
do
|
base
|
...
...
@@ -169,4 +170,5 @@ module APIGuard
@scopes
=
scopes
end
end
end
end
\ No newline at end of file
lib/ci/api/api.rb
View file @
0a280158
...
...
@@ -3,7 +3,7 @@ Dir["#{Rails.root}/lib/ci/api/*.rb"].each {|file| require file}
module
Ci
module
API
class
API
<
Grape
::
API
include
APIGuard
include
::
API
::
APIGuard
version
'v1'
,
using: :path
rescue_from
ActiveRecord
::
RecordNotFound
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment