public
Fork of NZKoz/koz-rails
Description: Koz's rails git-svn clone
Homepage: http://www.rubyonrails.org
Clone URL: git://github.com/eventualbuddha/koz-rails.git
Search Repo:
Simplify some rails info methods


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8436 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
bitsweat (author)
Tue Dec 18 20:21:02 -0800 2007
commit  45fcf8b652207bb233440b856ad7923ffdfdd04e
tree    deb08b87f6e9cb338dae94fdf5bce343db347686
parent  e7af172d68c05d9a864c3d30933f71e8a62acf2a
...
3
4
5
6
 
7
8
9
10
 
11
12
13
...
16
17
18
19
 
20
21
22
23
24
25
26
 
27
28
29
30
31
 
32
33
34
...
51
52
53
54
 
55
56
57
...
84
85
86
87
 
88
89
90
91
92
93
 
 
94
95
96
 
97
98
99
100
 
101
102
103
104
105
 
106
107
108
...
112
113
114
115
 
116
117
118
...
3
4
5
 
6
7
8
9
 
10
11
12
13
...
16
17
18
 
19
20
21
22
23
24
25
 
26
27
28
29
30
 
31
32
33
34
...
51
52
53
 
54
55
56
57
...
84
85
86
 
87
88
89
90
91
 
 
92
93
94
95
 
96
97
98
99
 
100
101
102
103
104
 
105
106
107
108
...
112
113
114
 
115
116
117
118
0
@@ -3,11 +3,11 @@ module Rails
0
     mattr_accessor :properties
0
     class << (@@properties = [])
0
       def names
0
- map { |name, value| name }
0
+ map &:first
0
       end
0
 
0
       def value_for(property_name)
0
- if property = find { |name, value| name == property_name }
0
+ if property = assoc(property_name)
0
           property.last
0
         end
0
       end
0
@@ -16,19 +16,19 @@ module Rails
0
     class << self #:nodoc:
0
       def property(name, value = nil)
0
         value ||= yield
0
- properties << [name, value] if value
0
+ properties << [name, value] if value
0
       rescue Exception
0
       end
0
 
0
       def components
0
         %w( active_record action_pack active_resource action_mailer active_support )
0
       end
0
-
0
+
0
       def component_version(component)
0
         require "#{component}/version"
0
         "#{component.classify}::VERSION::STRING".constantize
0
       end
0
-
0
+
0
       def edge_rails_revision(info = svn_info)
0
         info[/^Revision: (\d+)/, 1] || freeze_edge_version
0
       end
0
@@ -51,7 +51,7 @@ module Rails
0
       end
0
 
0
       alias inspect to_s
0
-
0
+
0
       def to_html
0
         returning table = '<table>' do
0
           properties.each do |(name, value)|
0
@@ -84,25 +84,25 @@ module Rails
0
     property 'RubyGems version' do
0
       Gem::RubyGemsVersion
0
     end
0
-
0
+
0
     # The Rails version.
0
     property 'Rails version' do
0
       Rails::VERSION::STRING
0
     end
0
-
0
- # Versions of each Rails component (Active Record, Action Pack,
0
+
0
+ # Versions of each Rails component (Active Record, Action Pack,
0
     # Active Resource, Action Mailer, and Active Support).
0
     components.each do |component|
0
- property "#{component.titlecase} version" do
0
+ property "#{component.titlecase} version" do
0
         component_version(component)
0
       end
0
     end
0
-
0
+
0
     # The Rails SVN revision, if it's checked out into vendor/rails.
0
     property 'Edge Rails revision' do
0
       edge_rails_revision
0
     end
0
-
0
+
0
     # The application's location on the filesystem.
0
     property 'Application root' do
0
       File.expand_path(RAILS_ROOT)
0
@@ -112,7 +112,7 @@ module Rails
0
     property 'Environment' do
0
       RAILS_ENV
0
     end
0
-
0
+
0
     # The name of the database adapter for the current environment.
0
     property 'Database adapter' do
0
       ActiveRecord::Base.configurations[RAILS_ENV]['adapter']

Comments

    No one has commented yet.