Sha256: 53a40961ac31d5fe5eb4c44c7c129a77f34235d22b5bba1cb82f3aa0354b595f

Contents?: true

Size: 336 Bytes

Versions: 3

Compression:

Stored size: 336 Bytes

Contents

module Rip
  class UI
    def initialize(io=nil)
      @io = io
    end

    def puts(*args)
      return unless @io

      if args.empty?
        @io.puts ""
      else
        args.each { |msg| @io.puts(msg) }
      end

      @io.flush
      nil
    end

    def abort(msg)
      @io && Kernel.abort("rip: #{msg}")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rip-0.0.3 lib/rip/ui.rb
rip-0.0.2 lib/rip/ui.rb
rip-0.0.1 lib/rip/ui.rb