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
98f12ab2
Commit
98f12ab2
authored
Sep 19, 2019
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support IS_GITLAB_EE switch in Rails config
parent
99998850
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
21 deletions
+28
-21
config/application.rb
config/application.rb
+28
-21
No files found.
config/application.rb
View file @
98f12ab2
...
...
@@ -13,6 +13,7 @@ Bundler.require(*Rails.groups)
module
Gitlab
class
Application
<
Rails
::
Application
require_dependency
Rails
.
root
.
join
(
'lib/gitlab'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/utils'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/wrapper'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/cache'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/queues'
)
...
...
@@ -46,9 +47,10 @@ module Gitlab
config
.
generators
.
templates
.
push
(
"
#{
config
.
root
}
/generator_templates"
)
if
Gitlab
.
ee?
ee_paths
=
config
.
eager_load_paths
.
each_with_object
([])
do
|
path
,
memo
|
ee_path
=
config
.
root
.
join
(
'ee'
,
Pathname
.
new
(
path
).
relative_path_from
(
config
.
root
))
memo
<<
ee_path
.
to_s
if
ee_path
.
exist?
memo
<<
ee_path
.
to_s
end
# Eager load should load CE first
...
...
@@ -58,6 +60,7 @@ module Gitlab
# Other than Ruby modules we load EE first
config
.
paths
[
'lib/tasks'
].
unshift
"
#{
config
.
root
}
/ee/lib/tasks"
config
.
paths
[
'app/views'
].
unshift
"
#{
config
.
root
}
/ee/app/views"
end
# Rake tasks ignore the eager loading settings, so we need to set the
# autoload paths explicitly
...
...
@@ -178,16 +181,18 @@ module Gitlab
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/node_modules/xterm/src/"
config
.
assets
.
precompile
<<
"xterm.css"
if
Gitlab
.
ee?
%w[images javascripts stylesheets]
.
each
do
|
path
|
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/ee/app/assets/
#{
path
}
"
config
.
assets
.
precompile
<<
"jira_connect.js"
config
.
assets
.
precompile
<<
"pages/jira_connect.css"
end
end
# Import path for EE specific SCSS entry point
# In CE it will import a noop file, in EE a functioning file
# Order is important, so that the ee file takes precedence:
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/ee/app/assets/stylesheets/_ee"
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/ee/app/assets/stylesheets/_ee"
if
Gitlab
.
ee?
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/app/assets/stylesheets/_ee"
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/vendor/assets/javascripts/"
...
...
@@ -197,6 +202,7 @@ module Gitlab
# See https://gitlab.com/gitlab-org/gitlab-foss/issues/64091#note_194512508
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/node_modules"
if
Gitlab
.
ee?
# Compile non-JS/CSS assets in the ee/app/assets folder by default
# Mimic sprockets-rails default: https://github.com/rails/sprockets-rails/blob/v3.2.1/lib/sprockets/railtie.rb#L84-L87
LOOSE_EE_APP_ASSETS
=
lambda
do
|
logical_path
,
filename
|
...
...
@@ -204,6 +210,7 @@ module Gitlab
!
[
'.js'
,
'.css'
,
''
].
include?
(
File
.
extname
(
logical_path
))
end
config
.
assets
.
precompile
<<
LOOSE_EE_APP_ASSETS
end
# Version of your assets, change this if you want to expire all your assets
config
.
assets
.
version
=
'1.0'
...
...
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