Skip to content

Commit 6c69221

Browse files
rizwanrezajosevalim
authored andcommitted
Takes out stale methods relating to edge_rails_version
Signed-off-by: José Valim <[email protected]>
1 parent fa5f936 commit 6c69221

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

railties/lib/rails/info.rb

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,6 @@ def framework_version(framework)
3535
end
3636
end
3737

38-
def edge_rails_revision(info = git_info)
39-
info[/commit ([a-z0-9-]+)/, 1] || freeze_edge_version
40-
end
41-
42-
def freeze_edge_version
43-
if File.exist?(rails_vendor_root)
44-
begin
45-
Dir[File.join(rails_vendor_root, 'REVISION_*')].first.scan(/_(\d+)$/).first.first
46-
rescue
47-
Dir[File.join(rails_vendor_root, 'TAG_*')].first.scan(/_(.+)$/).first.first rescue 'unknown'
48-
end
49-
end
50-
end
51-
5238
def to_s
5339
column_width = properties.names.map {|name| name.length}.max
5440
info = properties.map do |name, value|
@@ -75,20 +61,6 @@ def to_html
7561
table << '</table>'
7662
end
7763
end
78-
79-
protected
80-
def rails_vendor_root
81-
@rails_vendor_root ||= "#{Rails.root}/vendor/rails"
82-
end
83-
84-
def git_info
85-
env_lang, ENV['LC_ALL'] = ENV['LC_ALL'], 'C'
86-
Dir.chdir(rails_vendor_root) do
87-
silence_stderr { `git log -n 1` }
88-
end
89-
ensure
90-
ENV['LC_ALL'] = env_lang
91-
end
9264
end
9365

9466
# The Ruby version and platform, e.g. "1.8.2 (powerpc-darwin8.2.0)".
@@ -120,11 +92,6 @@ def git_info
12092
Rails.configuration.middleware.active.map(&:inspect)
12193
end
12294

123-
# The Rails Git revision, if it's checked out into vendor/rails.
124-
property 'Edge Rails revision' do
125-
edge_rails_revision
126-
end
127-
12895
# The application's location on the filesystem.
12996
property 'Application root' do
13097
File.expand_path(Rails.root)

railties/test/rails_info_test.rb

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,6 @@ def setup
1414
silence_warnings { load 'rails/info.rb' }
1515
end
1616

17-
def test_edge_rails_revision_not_set_when_svn_info_is_empty
18-
Rails::Info.property 'Test that this will not be defined' do
19-
Rails::Info.edge_rails_revision ''
20-
end
21-
assert !property_defined?('Test that this will not be defined')
22-
end
23-
24-
def test_edge_rails_revision_extracted_from_svn_info
25-
Rails::Info.property 'Test Edge Rails revision' do
26-
Rails::Info.edge_rails_revision <<-EOS
27-
commit 420c4b3d8878156d04f45e47050ddc62ae00c68c
28-
Author: David Heinemeier Hansson <[email protected]>
29-
Date: Sun Apr 13 17:33:27 2008 -0500
30-
31-
Added Rails.public_path to control where HTML and assets are expected to be loaded from
32-
EOS
33-
end
34-
35-
assert_property 'Test Edge Rails revision', '420c4b3d8878156d04f45e47050ddc62ae00c68c'
36-
end
37-
3817
def test_property_with_block_swallows_exceptions_and_ignores_property
3918
assert_nothing_raised do
4019
Rails::Info.module_eval do

0 commit comments

Comments
 (0)