Use 1.9 compatible method to compute frame length

This commit is contained in:
Markus Schirp 2014-07-17 15:26:42 +00:00
parent bc8ccb6b54
commit 9af927befb
2 changed files with 2 additions and 3 deletions

View file

@ -4,6 +4,7 @@ module Mutant
class CLI < self class CLI < self
include Concord.new(:output) include Concord.new(:output)
NL = "\n".freeze
CLEAR_PREV_LINE = "\e[1A\e[2K".freeze CLEAR_PREV_LINE = "\e[1A\e[2K".freeze
# Output abstraction to decouple tty? from buffer # Output abstraction to decouple tty? from buffer
@ -112,7 +113,7 @@ module Mutant
# #
def swap(frame) def swap(frame)
output.write(frame) output.write(frame)
@last_length = frame.lines.length @last_length = frame.split(NL).length
end end
# Call block throttled # Call block throttled

View file

@ -5,8 +5,6 @@ module Mutant
class Printer class Printer
include AbstractType, Delegator, Adamantium::Flat, Concord.new(:output, :object) include AbstractType, Delegator, Adamantium::Flat, Concord.new(:output, :object)
NL = "\n".freeze
# Run printer on object to output # Run printer on object to output
# #
# @param [IO] output # @param [IO] output