Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
6c692219
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,发现更多精彩内容 >>
提交
6c692219
编写于
5月 16, 2010
作者:
R
Rizwan Reza
提交者:
José Valim
5月 16, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Takes out stale methods relating to edge_rails_version
Signed-off-by:
N
José Valim
<
jose.valim@gmail.com
>
上级
fa5f9369
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
54 deletion
+0
-54
railties/lib/rails/info.rb
railties/lib/rails/info.rb
+0
-33
railties/test/rails_info_test.rb
railties/test/rails_info_test.rb
+0
-21
未找到文件。
railties/lib/rails/info.rb
浏览文件 @
6c692219
...
...
@@ -35,20 +35,6 @@ def framework_version(framework)
end
end
def
edge_rails_revision
(
info
=
git_info
)
info
[
/commit ([a-z0-9-]+)/
,
1
]
||
freeze_edge_version
end
def
freeze_edge_version
if
File
.
exist?
(
rails_vendor_root
)
begin
Dir
[
File
.
join
(
rails_vendor_root
,
'REVISION_*'
)].
first
.
scan
(
/_(\d+)$/
).
first
.
first
rescue
Dir
[
File
.
join
(
rails_vendor_root
,
'TAG_*'
)].
first
.
scan
(
/_(.+)$/
).
first
.
first
rescue
'unknown'
end
end
end
def
to_s
column_width
=
properties
.
names
.
map
{
|
name
|
name
.
length
}.
max
info
=
properties
.
map
do
|
name
,
value
|
...
...
@@ -75,20 +61,6 @@ def to_html
table
<<
'</table>'
end
end
protected
def
rails_vendor_root
@rails_vendor_root
||=
"
#{
Rails
.
root
}
/vendor/rails"
end
def
git_info
env_lang
,
ENV
[
'LC_ALL'
]
=
ENV
[
'LC_ALL'
],
'C'
Dir
.
chdir
(
rails_vendor_root
)
do
silence_stderr
{
`git log -n 1`
}
end
ensure
ENV
[
'LC_ALL'
]
=
env_lang
end
end
# The Ruby version and platform, e.g. "1.8.2 (powerpc-darwin8.2.0)".
...
...
@@ -120,11 +92,6 @@ def git_info
Rails
.
configuration
.
middleware
.
active
.
map
(
&
:inspect
)
end
# The Rails Git revision, if it's checked out into vendor/rails.
property
'Edge Rails revision'
do
edge_rails_revision
end
# The application's location on the filesystem.
property
'Application root'
do
File
.
expand_path
(
Rails
.
root
)
...
...
railties/test/rails_info_test.rb
浏览文件 @
6c692219
...
...
@@ -14,27 +14,6 @@ def setup
silence_warnings
{
load
'rails/info.rb'
}
end
def
test_edge_rails_revision_not_set_when_svn_info_is_empty
Rails
::
Info
.
property
'Test that this will not be defined'
do
Rails
::
Info
.
edge_rails_revision
''
end
assert
!
property_defined?
(
'Test that this will not be defined'
)
end
def
test_edge_rails_revision_extracted_from_svn_info
Rails
::
Info
.
property
'Test Edge Rails revision'
do
Rails
::
Info
.
edge_rails_revision
<<-
EOS
commit 420c4b3d8878156d04f45e47050ddc62ae00c68c
Author: David Heinemeier Hansson <david@loudthinking.com>
Date: Sun Apr 13 17:33:27 2008 -0500
Added Rails.public_path to control where HTML and assets are expected to be loaded from
EOS
end
assert_property
'Test Edge Rails revision'
,
'420c4b3d8878156d04f45e47050ddc62ae00c68c'
end
def
test_property_with_block_swallows_exceptions_and_ignores_property
assert_nothing_raised
do
Rails
::
Info
.
module_eval
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录