1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Takes out stale methods relating to edge_rails_version

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
Rizwan Reza 2010-05-16 19:45:30 +04:30 committed by José Valim
parent fa5f93698d
commit 6c69221985
2 changed files with 0 additions and 54 deletions

View file

@ -35,20 +35,6 @@ module Rails
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 @@ module Rails
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 @@ module Rails
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)

View file

@ -14,27 +14,6 @@ class InfoTest < ActiveSupport::TestCase
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