Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ruby 1.9 compat: Update idiosyncratic block variable usage. Closes #1…

…0546.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8435 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 11a75f9a3801d544194e90423ff5f16ffc0eb21e 1 parent a5ca52f
@jeremy jeremy authored
Showing with 7 additions and 5 deletions.
  1. +1 −1  railties/CHANGELOG
  2. +6 −4 railties/builtin/rails_info/rails/info.rb
View
2  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)
View
10 railties/builtin/rails_info/rails/info.rb
@@ -3,14 +3,16 @@ module Info
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
Please sign in to comment.
Something went wrong with that request. Please try again.