src/cli/openstudio_cli.rb
# This is the save puts to use to catch EPIPE. Uses `puts` on the given IO object and safely ignores any Errno::EPIPE
#
# @param [String] message Message to output
# @param [Hash] opts Options hash
#
This is the save puts to use to catch EPIPE. Uses `puts` on the given IO object and safely ignores any Errno::EPIPE
This is the save puts to use to catch EPIPE . Uses ` puts ` on the given IO object and safely ignores any Errno :: EPIPE
def safe_puts(message=nil, opts=nil)
  message ||= ''
  opts = {
      io: $stdout,
      printer: :puts
  }.merge(opts || {})
  begin
    opts[:io].send(opts[:printer], message)
  rescue Errno::EPIPE
    return
  end
end
def safe_puts ( message = nil , opts = nil ) message ||= '' opts = { io : $stdout , printer : :puts } . merge ( opts || { } ) begin opts [ :io ] . send ( opts [ :printer ] , message ) rescue Errno :: EPIPE return end end
This is the save puts to use to catch EPIPE.
This is the save puts to use to catch EPIPE .
# This is what makes this a `safe` puts
message
<not_specific>
opts
<not_specific>
<not_specific>
opts Options hash
opts Options hash