Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
98f12ab2
提交
98f12ab2
编辑于
5 years ago
作者:
Winnie Hellmann
浏览文件
操作
下载
补丁
差异文件
Support IS_GITLAB_EE switch in Rails config
上级
99998850
No related branches found
No related tags found
无相关合并请求
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
config/application.rb
+28
-21
28 个添加, 21 个删除
config/application.rb
有
28 个添加
和
21 个删除
config/application.rb
+
28
−
21
浏览文件 @
98f12ab2
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
module
Gitlab
module
Gitlab
class
Application
<
Rails
::
Application
class
Application
<
Rails
::
Application
require_dependency
Rails
.
root
.
join
(
'lib/gitlab'
)
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/wrapper'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/cache'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/cache'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/queues'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/queues'
)
...
@@ -46,18 +47,20 @@ class Application < Rails::Application
...
@@ -46,18 +47,20 @@ class Application < Rails::Application
config
.
generators
.
templates
.
push
(
"
#{
config
.
root
}
/generator_templates"
)
config
.
generators
.
templates
.
push
(
"
#{
config
.
root
}
/generator_templates"
)
ee_paths
=
config
.
eager_load_paths
.
each_with_object
([])
do
|
path
,
memo
|
if
Gitlab
.
ee?
ee_path
=
config
.
root
.
join
(
'ee'
,
Pathname
.
new
(
path
).
relative_path_from
(
config
.
root
))
ee_paths
=
config
.
eager_load_paths
.
each_with_object
([])
do
|
path
,
memo
|
memo
<<
ee_path
.
to_s
if
ee_path
.
exist?
ee_path
=
config
.
root
.
join
(
'ee'
,
Pathname
.
new
(
path
).
relative_path_from
(
config
.
root
))
end
memo
<<
ee_path
.
to_s
end
# Eager load should load CE first
# Eager load should load CE first
config
.
eager_load_paths
.
push
(
*
ee_paths
)
config
.
eager_load_paths
.
push
(
*
ee_paths
)
config
.
helpers_paths
.
push
"
#{
config
.
root
}
/ee/app/helpers"
config
.
helpers_paths
.
push
"
#{
config
.
root
}
/ee/app/helpers"
# Other than Ruby modules we load EE first
# Other than Ruby modules we load EE first
config
.
paths
[
'lib/tasks'
].
unshift
"
#{
config
.
root
}
/ee/lib/tasks"
config
.
paths
[
'lib/tasks'
].
unshift
"
#{
config
.
root
}
/ee/lib/tasks"
config
.
paths
[
'app/views'
].
unshift
"
#{
config
.
root
}
/ee/app/views"
config
.
paths
[
'app/views'
].
unshift
"
#{
config
.
root
}
/ee/app/views"
end
# Rake tasks ignore the eager loading settings, so we need to set the
# Rake tasks ignore the eager loading settings, so we need to set the
# autoload paths explicitly
# autoload paths explicitly
...
@@ -178,16 +181,18 @@ class Application < Rails::Application
...
@@ -178,16 +181,18 @@ class Application < Rails::Application
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/node_modules/xterm/src/"
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/node_modules/xterm/src/"
config
.
assets
.
precompile
<<
"xterm.css"
config
.
assets
.
precompile
<<
"xterm.css"
%w[images javascripts stylesheets]
.
each
do
|
path
|
if
Gitlab
.
ee?
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/ee/app/assets/
#{
path
}
"
%w[images javascripts stylesheets]
.
each
do
|
path
|
config
.
assets
.
precompile
<<
"jira_connect.js"
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/ee/app/assets/
#{
path
}
"
config
.
assets
.
precompile
<<
"pages/jira_connect.css"
config
.
assets
.
precompile
<<
"jira_connect.js"
config
.
assets
.
precompile
<<
"pages/jira_connect.css"
end
end
end
# Import path for EE specific SCSS entry point
# Import path for EE specific SCSS entry point
# In CE it will import a noop file, in EE a functioning file
# In CE it will import a noop file, in EE a functioning file
# Order is important, so that the ee file takes precedence:
# 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
}
/app/assets/stylesheets/_ee"
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/vendor/assets/javascripts/"
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/vendor/assets/javascripts/"
...
@@ -197,13 +202,15 @@ class Application < Rails::Application
...
@@ -197,13 +202,15 @@ class Application < Rails::Application
# See https://gitlab.com/gitlab-org/gitlab-foss/issues/64091#note_194512508
# See https://gitlab.com/gitlab-org/gitlab-foss/issues/64091#note_194512508
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/node_modules"
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/node_modules"
# Compile non-JS/CSS assets in the ee/app/assets folder by default
if
Gitlab
.
ee?
# Mimic sprockets-rails default: https://github.com/rails/sprockets-rails/blob/v3.2.1/lib/sprockets/railtie.rb#L84-L87
# Compile non-JS/CSS assets in the ee/app/assets folder by default
LOOSE_EE_APP_ASSETS
=
lambda
do
|
logical_path
,
filename
|
# Mimic sprockets-rails default: https://github.com/rails/sprockets-rails/blob/v3.2.1/lib/sprockets/railtie.rb#L84-L87
filename
.
start_with?
(
config
.
root
.
join
(
"ee/app/assets"
).
to_s
)
&&
LOOSE_EE_APP_ASSETS
=
lambda
do
|
logical_path
,
filename
|
!
[
'.js'
,
'.css'
,
''
].
include?
(
File
.
extname
(
logical_path
))
filename
.
start_with?
(
config
.
root
.
join
(
"ee/app/assets"
).
to_s
)
&&
!
[
'.js'
,
'.css'
,
''
].
include?
(
File
.
extname
(
logical_path
))
end
config
.
assets
.
precompile
<<
LOOSE_EE_APP_ASSETS
end
end
config
.
assets
.
precompile
<<
LOOSE_EE_APP_ASSETS
# Version of your assets, change this if you want to expire all your assets
# Version of your assets, change this if you want to expire all your assets
config
.
assets
.
version
=
'1.0'
config
.
assets
.
version
=
'1.0'
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录