aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-12-19 01:18:45 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-12-19 01:18:45 +0000
commit11a75f9a3801d544194e90423ff5f16ffc0eb21e (patch)
tree21dd8be3ec30267f6476ee893fecb5bb3096cd4f /railties
parenta5ca52f4a5c9d87834f3d4bf3073d12df9a9dc74 (diff)
downloadrails-11a75f9a3801d544194e90423ff5f16ffc0eb21e.tar.gz
rails-11a75f9a3801d544194e90423ff5f16ffc0eb21e.tar.bz2
rails-11a75f9a3801d544194e90423ff5f16ffc0eb21e.zip
Ruby 1.9 compat: Update idiosyncratic block variable usage. Closes #10546.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8435 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/builtin/rails_info/rails/info.rb10
2 files changed, 7 insertions, 5 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 1eec091371..466a1dc335 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,6 +1,6 @@
*SVN*
-* Ruby 1.9 compatibility. #1689 [Cheah Chu Yeow]
+* Ruby 1.9 compatibility. #1689, #10546 [Cheah Chu Yeow, frederico]
*2.0.2* (December 16th, 2007)
diff --git a/railties/builtin/rails_info/rails/info.rb b/railties/builtin/rails_info/rails/info.rb
index b73cc13409..c8bc9cb4f1 100644
--- a/railties/builtin/rails_info/rails/info.rb
+++ b/railties/builtin/rails_info/rails/info.rb
@@ -3,14 +3,16 @@ module Rails
mattr_accessor :properties
class << (@@properties = [])
def names
- map {|(name, )| name}
+ map { |name, value| name }
end
-
+
def value_for(property_name)
- find {|(name, )| name == property_name}.last rescue nil
+ if property = find { |name, value| name == property_name }
+ property.last
+ end
end
end
-
+
class << self #:nodoc:
def property(name, value = nil)
value ||= yield