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>
This commit is contained in:
Jeff Schwab 2009-03-05 21:30:26 -05:00 committed by Jeremy Kemper
parent affe50105f
commit e609d83f1a
1 changed files with 2 additions and 1 deletions

View File

@ -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