Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
6f194bb3
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6f194bb3
编写于
9月 04, 2010
作者:
J
José Valim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small tidy up on Rails::Engine.
上级
23a94559
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
49 addition
and
48 deletion
+49
-48
railties/lib/rails/engine.rb
railties/lib/rails/engine.rb
+49
-48
未找到文件。
railties/lib/rails/engine.rb
浏览文件 @
6f194bb3
...
...
@@ -288,7 +288,6 @@ def endpoint(endpoint = nil)
end
def
namespace
(
mod
)
# TODO: extract that into a module
engine_name
(
generate_railtie_name
(
mod
))
_railtie
=
self
...
...
@@ -386,7 +385,7 @@ def config
# per engine and get the engine as a block parameter
initializer
:set_autoload_paths
,
:before
=>
:bootstrap_hook
do
|
app
|
ActiveSupport
::
Dependencies
.
autoload_paths
.
unshift
(
*
_all_autoload_paths
)
ActiveSupport
::
Dependencies
.
autoload_once_paths
.
unshift
(
*
config
.
autoload_once_paths
)
ActiveSupport
::
Dependencies
.
autoload_once_paths
.
unshift
(
*
_all_
autoload_once_paths
)
# Freeze so future modifications will fail rather than do nothing mysteriously
config
.
autoload_paths
.
freeze
...
...
@@ -419,11 +418,9 @@ def config
initializer
:add_view_paths
do
views
=
paths
.
app
.
views
.
to_a
ActiveSupport
.
on_load
(
:action_controller
)
do
prepend_view_path
(
views
)
end
ActiveSupport
.
on_load
(
:action_mailer
)
do
prepend_view_path
(
views
)
unless
views
.
empty?
ActiveSupport
.
on_load
(
:action_controller
){
prepend_view_path
(
views
)
}
ActiveSupport
.
on_load
(
:action_mailer
){
prepend_view_path
(
views
)
}
end
end
...
...
@@ -433,7 +430,7 @@ def config
end
initializer
:append_asset_paths
do
config
.
asset_path
=
"/
#{
engine_name
}
%s"
unless
config
.
asset_path
config
.
asset_path
||=
"/
#{
engine_name
}
%s"
public_path
=
config
.
paths
.
public
.
to_a
.
first
if
config
.
compiled_asset_path
&&
File
.
exist?
(
public_path
)
...
...
@@ -479,6 +476,10 @@ def default_middleware_stack
ActionDispatch
::
MiddlewareStack
.
new
end
def
_all_autoload_once_paths
config
.
autoload_once_paths
end
def
_all_autoload_paths
@_all_autoload_paths
||=
(
config
.
autoload_paths
+
config
.
eager_load_paths
+
config
.
autoload_once_paths
).
uniq
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录