提交 6c692219 编写于 作者: R Rizwan Reza 提交者: José Valim

Takes out stale methods relating to edge_rails_version

Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 fa5f9369
......@@ -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)
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册