]> git.wincent.com - wikitext.git/commitdiff
Ruby 1.9: use String#each_line instead of #each
authorWincent Colaiuta <win@wincent.com>
Fri, 13 Feb 2009 17:27:31 +0000 (18:27 +0100)
committerWincent Colaiuta <win@wincent.com>
Fri, 13 Feb 2009 17:27:31 +0000 (18:27 +0100)
String#each isn't implemented in 1.9, so switch to #each_line,
which should work in both 1.8.6 and 1.9.1.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
spec/spec_helper.rb

index af10e4ce942d52354bd00e9a07d7a6767d08df95..4fe70dad8342e2b7b71ff9973b5367e4cb8e0dac 100644 (file)
@@ -34,7 +34,7 @@ def dedent spaces, string = nil
   else
     raise 'Invalid argument'
   end
-  string.each do |line|
+  string.each_line do |line|
     if not line =~ /\A {#{spaces.to_i}}/
       raise "Underlength indent for line: #{line.inspect}"
     end