Skip to content

Commit

Permalink
Revert "simpler to_lines implementation"
Browse files Browse the repository at this point in the history
This reverts commit 5336777.

Doesn't seem to work on certain ruby implementations. Strange...
  • Loading branch information
jnicklas committed Feb 5, 2009
1 parent 5336777 commit bff0fbd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/templater/core_ext/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ def realign_indentation
# for that purpose. Since defining to_a for ruby-1.9.1 is also bad idea,
# even if it were necessary, it should not be to_a but such like to_lines
# which is as follows.
def to_lines
Array(self)
if RUBY_VERSION <= "1.8.6"
def to_lines
to_a
end
else
def to_lines
each_line.to_a
end
end
end

0 comments on commit bff0fbd

Please sign in to comment.