Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
01ab6f96
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,发现更多精彩内容 >>
提交
01ab6f96
编写于
10月 14, 2010
作者:
J
José Valim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove :cache => true on lookup templates initialization.
上级
aa508c9b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
3 addition
and
53 deletion
+3
-53
actionpack/lib/action_view/lookup_context.rb
actionpack/lib/action_view/lookup_context.rb
+1
-1
actionpack/lib/action_view/renderer/template_renderer.rb
actionpack/lib/action_view/renderer/template_renderer.rb
+1
-1
actionpack/lib/action_view/template.rb
actionpack/lib/action_view/template.rb
+0
-9
actionpack/lib/action_view/template/inline.rb
actionpack/lib/action_view/template/inline.rb
+0
-20
actionpack/test/controller/new_base/render_once_test.rb
actionpack/test/controller/new_base/render_once_test.rb
+1
-10
actionpack/test/template/lookup_context_test.rb
actionpack/test/template/lookup_context_test.rb
+0
-4
actionpack/test/template/template_test.rb
actionpack/test/template/template_test.rb
+0
-8
未找到文件。
actionpack/lib/action_view/lookup_context.rb
浏览文件 @
01ab6f96
...
...
@@ -61,7 +61,7 @@ def initialize
def
initialize
(
view_paths
,
details
=
{})
@details
,
@details_key
=
{
:handlers
=>
default_handlers
},
nil
@frozen_formats
,
@skip_default_locale
=
false
,
false
@cache
=
details
.
key?
(
:cache
)
?
details
.
delete
(
:cache
)
:
true
@cache
=
true
self
.
view_paths
=
view_paths
self
.
registered_detail_setters
.
each
do
|
key
,
setter
|
...
...
actionpack/lib/action_view/renderer/template_renderer.rb
浏览文件 @
01ab6f96
...
...
@@ -46,7 +46,7 @@ def determine_template(options) #:nodoc:
with_fallbacks
{
find_template
(
options
[
:file
],
options
[
:prefix
],
false
,
keys
)
}
elsif
options
.
key?
(
:inline
)
handler
=
Template
.
handler_class_for_extension
(
options
[
:type
]
||
"erb"
)
Template
::
Inline
.
new
(
options
[
:inline
]
,
handler
,
:locals
=>
keys
)
Template
.
new
(
options
[
:inline
],
"inline template"
,
handler
,
:locals
=>
keys
)
elsif
options
.
key?
(
:template
)
options
[
:template
].
respond_to?
(
:render
)
?
options
[
:template
]
:
find_template
(
options
[
:template
],
options
[
:prefix
],
false
,
keys
)
...
...
actionpack/lib/action_view/template.rb
浏览文件 @
01ab6f96
...
...
@@ -93,7 +93,6 @@ class Template
autoload
:Error
autoload
:Handler
autoload
:Handlers
autoload
:Inline
autoload
:Text
end
...
...
@@ -185,14 +184,6 @@ def rerender(view)
end
end
def
hash
identifier
.
hash
end
def
eql?
(
other
)
other
.
is_a?
(
Template
)
&&
other
.
identifier
==
identifier
end
def
inspect
@inspect
||=
if
defined?
(
Rails
.
root
)
...
...
actionpack/lib/action_view/template/inline.rb
已删除
100644 → 0
浏览文件 @
aa508c9b
require
'digest/md5'
module
ActionView
class
Template
class
Inline
<
::
ActionView
::
Template
def
initialize
(
source
,
handler
,
options
=
{})
super
(
source
,
"inline template"
,
handler
,
options
)
end
def
md5_source
@md5_source
||=
Digest
::
MD5
.
hexdigest
(
source
)
end
def
eql?
(
other
)
other
.
is_a?
(
Inline
)
&&
other
.
md5_source
==
md5_source
end
end
end
end
\ No newline at end of file
actionpack/test/controller/new_base/render_once_test.rb
浏览文件 @
01ab6f96
...
...
@@ -79,17 +79,8 @@ def test_with_nil_prefix_option
end
end
class
Test
WithResolverCach
e
<
Rack
::
TestCase
class
Test
RenderOnc
e
<
Rack
::
TestCase
testing
RenderTemplate
::
RenderOnceController
include
Tests
end
class
TestWithoutResolverCache
<
Rack
::
TestCase
testing
RenderTemplate
::
RenderOnceController
include
Tests
def
setup
RenderTemplate
::
RenderOnceController
::
RESOLVER
.
stubs
(
:caching?
).
returns
(
false
)
end
end
end
actionpack/test/template/lookup_context_test.rb
浏览文件 @
01ab6f96
...
...
@@ -180,10 +180,6 @@ def teardown
assert_not_equal
template
,
old_template
end
test
"can have cache disabled on initialization"
do
assert
!
ActionView
::
LookupContext
.
new
(
FIXTURE_LOAD_PATH
,
:cache
=>
false
).
cache
end
end
class
LookupContextWithFalseCaching
<
ActiveSupport
::
TestCase
...
...
actionpack/test/template/template_test.rb
浏览文件 @
01ab6f96
...
...
@@ -151,14 +151,6 @@ def test_rerender_raises_an_error_without_virtual_path
end
end
def
test_inline_template_is_only_equal_if_source_match
inline1
=
ActionView
::
Template
::
Inline
.
new
(
"sample"
,
ERBHandler
)
inline2
=
ActionView
::
Template
::
Inline
.
new
(
"sample"
,
ERBHandler
)
inline3
=
ActionView
::
Template
::
Inline
.
new
(
"other"
,
ERBHandler
)
assert
inline1
.
eql?
(
inline2
)
assert
!
inline1
.
eql?
(
inline3
)
end
if
"ruby"
.
encoding_aware?
def
test_resulting_string_is_utf8
@template
=
new_template
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录