From 36c095a4dfef7c0219596193fafb36bcf097c1e9 Mon Sep 17 00:00:00 2001 From: Jeff Schwab Date: Thu, 5 Mar 2009 21:30:26 -0500 Subject: [PATCH] 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. --- railties/lib/commands/plugin.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/railties/lib/commands/plugin.rb b/railties/lib/commands/plugin.rb index 9ff4739..b20e9e8 100644 --- a/railties/lib/commands/plugin.rb +++ b/railties/lib/commands/plugin.rb @@ -134,7 +134,8 @@ class RailsEnvironment def externals return [] unless use_externals? ext = `svn propget svn:externals "#{root}/vendor/plugins"` - ext.reject{ |line| line.strip == '' }.map do |line| + lines = ext.respond_to?(:lines) ? ext.lines : ext + lines.reject{ |line| line.strip == '' }.map do |line| line.strip.split(/\s+/, 2) end end -- 1.6.1.2