Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
624b1186
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,体验更适合开发者的 AI 搜索 >>
提交
624b1186
编写于
7月 25, 2011
作者:
T
thedarkone
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use shorter class-level File methods instead of going through File.stat.
上级
02691d35
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
5 addition
and
5 deletion
+5
-5
actionpack/lib/action_view/template/resolver.rb
actionpack/lib/action_view/template/resolver.rb
+1
-1
actionpack/test/template/asset_tag_helper_test.rb
actionpack/test/template/asset_tag_helper_test.rb
+2
-2
activesupport/lib/active_support/file_update_checker.rb
activesupport/lib/active_support/file_update_checker.rb
+1
-1
railties/lib/rails/code_statistics.rb
railties/lib/rails/code_statistics.rb
+1
-1
未找到文件。
actionpack/lib/action_view/template/resolver.rb
浏览文件 @
624b1186
...
...
@@ -161,7 +161,7 @@ def build_query(path, details)
# Returns the file mtime from the filesystem.
def
mtime
(
p
)
File
.
stat
(
p
).
mtime
File
.
mtime
(
p
)
end
# Extract handler and formats from path. If a format cannot be a found neither
...
...
actionpack/test/template/asset_tag_helper_test.rb
浏览文件 @
624b1186
...
...
@@ -481,7 +481,7 @@ def test_audio_tag
end
def
test_timebased_asset_id
expected_time
=
File
.
stat
(
File
.
expand_path
(
File
.
dirname
(
__FILE__
)
+
"/../fixtures/public/images/rails.png"
)).
mtime
.
to_i
.
to_s
expected_time
=
File
.
mtime
(
File
.
expand_path
(
File
.
dirname
(
__FILE__
)
+
"/../fixtures/public/images/rails.png"
))
.
to_i
.
to_s
assert_equal
%(<img alt="Rails" src="/images/rails.png?#{expected_time}" />)
,
image_tag
(
"rails.png"
)
end
...
...
@@ -512,7 +512,7 @@ def test_image_tag_interpreting_email_adding_optional_alt_tag
def
test_timebased_asset_id_with_relative_url_root
@controller
.
config
.
relative_url_root
=
"/collaboration/hieraki"
expected_time
=
File
.
stat
(
File
.
expand_path
(
File
.
dirname
(
__FILE__
)
+
"/../fixtures/public/images/rails.png"
)).
mtime
.
to_i
.
to_s
expected_time
=
File
.
mtime
(
File
.
expand_path
(
File
.
dirname
(
__FILE__
)
+
"/../fixtures/public/images/rails.png"
))
.
to_i
.
to_s
assert_equal
%(<img alt="Rails" src="#{@controller.config.relative_url_root}/images/rails.png?#{expected_time}" />)
,
image_tag
(
"rails.png"
)
end
...
...
activesupport/lib/active_support/file_update_checker.rb
浏览文件 @
624b1186
...
...
@@ -22,7 +22,7 @@ def initialize(paths, calculate=false, &block)
end
def
updated_at
paths
.
map
{
|
path
|
File
.
stat
(
path
).
mtime
}.
max
paths
.
map
{
|
path
|
File
.
mtime
(
path
)
}.
max
end
def
execute_if_updated
...
...
railties/lib/rails/code_statistics.rb
浏览文件 @
624b1186
...
...
@@ -30,7 +30,7 @@ def calculate_directory_statistics(directory, pattern = /.*\.rb$/)
stats
=
{
"lines"
=>
0
,
"codelines"
=>
0
,
"classes"
=>
0
,
"methods"
=>
0
}
Dir
.
foreach
(
directory
)
do
|
file_name
|
if
File
.
stat
(
directory
+
"/"
+
file_name
).
directory?
and
(
/^\./
!~
file_name
)
if
File
.
directory?
(
directory
+
"/"
+
file_name
)
and
(
/^\./
!~
file_name
)
newstats
=
calculate_directory_statistics
(
directory
+
"/"
+
file_name
,
pattern
)
stats
.
each
{
|
k
,
v
|
stats
[
k
]
+=
newstats
[
k
]
}
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录