Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
84961dc5
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,发现更多精彩内容 >>
提交
84961dc5
编写于
11月 14, 2013
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12889 from kuldeepaggarwal/speed_ups
Used Yield instead of block.call
上级
a23bf6f5
d3a1ce1c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
9 deletion
+9
-9
actionpack/lib/action_controller/metal/mime_responds.rb
actionpack/lib/action_controller/metal/mime_responds.rb
+2
-2
actionview/lib/action_view/helpers/atom_feed_helper.rb
actionview/lib/action_view/helpers/atom_feed_helper.rb
+2
-2
activerecord/test/cases/migrator_test.rb
activerecord/test/cases/migrator_test.rb
+3
-3
railties/lib/rails/generators/actions.rb
railties/lib/rails/generators/actions.rb
+2
-2
未找到文件。
actionpack/lib/action_controller/metal/mime_responds.rb
浏览文件 @
84961dc5
...
...
@@ -358,10 +358,10 @@ def collect_mimes_from_class_level #:nodoc:
#
# Sends :not_acceptable to the client and returns nil if no suitable format
# is available.
def
retrieve_collector_from_mimes
(
mimes
=
nil
,
&
block
)
#:nodoc:
def
retrieve_collector_from_mimes
(
mimes
=
nil
)
#:nodoc:
mimes
||=
collect_mimes_from_class_level
collector
=
Collector
.
new
(
mimes
)
block
.
call
(
collector
)
if
block_given?
yield
(
collector
)
if
block_given?
format
=
collector
.
negotiate_format
(
request
)
if
format
...
...
actionview/lib/action_view/helpers/atom_feed_helper.rb
浏览文件 @
84961dc5
...
...
@@ -135,11 +135,11 @@ def initialize(xml)
# Delegate to xml builder, first wrapping the element in a xhtml
# namespaced div element if the method and arguments indicate
# that an xhtml_block? is desired.
def
method_missing
(
method
,
*
arguments
,
&
block
)
def
method_missing
(
method
,
*
arguments
)
if
xhtml_block?
(
method
,
arguments
)
@xml
.
__send__
(
method
,
*
arguments
)
do
@xml
.
div
(
:xmlns
=>
'http://www.w3.org/1999/xhtml'
)
do
|
xhtml
|
block
.
call
(
xhtml
)
yield
(
xhtml
)
end
end
else
...
...
activerecord/test/cases/migrator_test.rb
浏览文件 @
84961dc5
...
...
@@ -346,11 +346,11 @@ def test_get_all_versions
end
private
def
m
(
name
,
version
,
&
block
)
def
m
(
name
,
version
)
x
=
Sensor
.
new
name
,
version
x
.
extend
(
Module
.
new
{
define_method
(
:up
)
{
block
.
call
(
:up
,
x
);
super
()
}
define_method
(
:down
)
{
block
.
call
(
:down
,
x
);
super
()
}
define_method
(
:up
)
{
yield
(
:up
,
x
);
super
()
}
define_method
(
:down
)
{
yield
(
:down
,
x
);
super
()
}
})
if
block_given?
end
...
...
railties/lib/rails/generators/actions.rb
浏览文件 @
84961dc5
...
...
@@ -84,10 +84,10 @@ def add_source(source, options={})
# environment(nil, env: "development") do
# "config.autoload_paths += %W(#{config.root}/extras)"
# end
def
environment
(
data
=
nil
,
options
=
{},
&
block
)
def
environment
(
data
=
nil
,
options
=
{}
)
sentinel
=
/class [a-z_:]+ < Rails::Application/i
env_file_sentinel
=
/Rails\.application\.configure do/
data
=
block
.
call
if
!
data
&&
block_given?
data
=
yield
if
!
data
&&
block_given?
in_root
do
if
options
[
:env
].
nil?
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录