aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/commands
diff options
context:
space:
mode:
authorJeff Schwab <jeff@schwabcenter.com>2009-03-05 21:30:26 -0500
committerJeremy Kemper <jeremy@bitsweat.net>2009-03-10 11:37:23 -0700
commite609d83f1a7f49bf8a9549c480a67ee045950336 (patch)
tree05bad07701a3bfe5ad375db5c431db5f9cb37171 /railties/lib/commands
parentaffe50105f7027a44eb6e9cfb56f5b3fc070b19b (diff)
downloadrails-e609d83f1a7f49bf8a9549c480a67ee045950336.tar.gz
rails-e609d83f1a7f49bf8a9549c480a67ee045950336.tar.bz2
rails-e609d83f1a7f49bf8a9549c480a67ee045950336.zip
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>
Diffstat (limited to 'railties/lib/commands')
-rw-r--r--railties/lib/commands/plugin.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/commands/plugin.rb b/railties/lib/commands/plugin.rb
index a67c2ab447..8589b1698d 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