Skip to content
This repository
Browse code

Fixed an incompatibility with Ruby 1.9.

Ruby 1.8 strings are Enumerable, but there is no String#lines method. In
Ruby 1.9, the situation is reversed.  To work around this disparity, the
RailsEnvironment#externals method now explicitly checks whether a String
responds_to? :lines.

[#2130 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit e609d83f1a7f49bf8a9549c480a67ee045950336 1 parent affe501
Jeff Schwab authored jeremy committed

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  railties/lib/commands/plugin.rb
3  railties/lib/commands/plugin.rb
@@ -134,7 +134,8 @@ def best_install_method
134 134
   def externals
135 135
     return [] unless use_externals?
136 136
     ext = `svn propget svn:externals "#{root}/vendor/plugins"`
137  
-    ext.reject{ |line| line.strip == '' }.map do |line| 
  137
+    lines = ext.respond_to?(:lines) ? ext.lines : ext
  138
+    lines.reject{ |line| line.strip == '' }.map do |line|
138 139
       line.strip.split(/\s+/, 2) 
139 140
     end
140 141
   end

0 notes on commit e609d83

Please sign in to comment.
Something went wrong with that request. Please try again.