lib/nanoc/cli/cleaning_stream.rb in nanoc-3.6.7 vs lib/nanoc/cli/cleaning_stream.rb in nanoc-3.6.8
- old
+ new
@@ -39,30 +39,30 @@
# @group IO proxy methods
# @see IO#write
def write(s)
- self._nanoc_swallow_broken_pipe_errors_while do
- @stream.write(self._nanoc_clean(s))
+ _nanoc_swallow_broken_pipe_errors_while do
+ @stream.write(_nanoc_clean(s))
end
end
# @see IO#<<
def <<(s)
- self._nanoc_swallow_broken_pipe_errors_while do
- @stream.<<(self._nanoc_clean(s))
+ _nanoc_swallow_broken_pipe_errors_while do
+ @stream.<<(_nanoc_clean(s))
end
end
# @see IO#tty?
def tty?
@cached_is_tty ||= @stream.tty?
end
# @see IO#flush
def flush
- self._nanoc_swallow_broken_pipe_errors_while do
+ _nanoc_swallow_broken_pipe_errors_while do
@stream.flush
end
end
# @see IO#tell
@@ -70,19 +70,19 @@
@stream.tell
end
# @see IO#print
def print(s)
- self._nanoc_swallow_broken_pipe_errors_while do
- @stream.print(self._nanoc_clean(s))
+ _nanoc_swallow_broken_pipe_errors_while do
+ @stream.print(_nanoc_clean(s))
end
end
# @see IO#puts
def puts(*s)
- self._nanoc_swallow_broken_pipe_errors_while do
- @stream.puts(*s.map { |ss| self._nanoc_clean(ss) })
+ _nanoc_swallow_broken_pipe_errors_while do
+ @stream.puts(*s.map { |ss| _nanoc_clean(ss) })
end
end
# @see StringIO#string
def string
@@ -114,23 +114,22 @@
@stream.winsize
end
# @see IO.winsize=
def winsize=(arg)
- @stream.winsize=(arg)
+ @stream.winsize = (arg)
end
protected
def _nanoc_clean(s)
- @stream_cleaners.inject(s) { |m,c| c.clean(m) }
+ @stream_cleaners.reduce(s) { |m, c| c.clean(m) }
end
def _nanoc_swallow_broken_pipe_errors_while
yield
rescue Errno::EPIPE
end
end
end
-