Sha256: 783f8f08ede9e11f5a3ceeeae392d07e66d491a0e35b8f491cadaa4b668c04a4
Contents?: true
Size: 777 Bytes
Versions: 12
Compression:
Stored size: 777 Bytes
Contents
require 'stringio' require 'rubygems/user_interaction' class MockGemUi < Gem::StreamUI class TermError < RuntimeError; end module TTY attr_accessor :tty def tty?() @tty = true unless defined?(@tty) @tty end end def initialize(input = "") ins = StringIO.new input outs = StringIO.new errs = StringIO.new ins.extend TTY outs.extend TTY errs.extend TTY super ins, outs, errs @terminated = false end def input @ins.string end def output @outs.string end def error @errs.string end def terminated? @terminated end def terminate_interaction(status=0) @terminated = true raise TermError unless status == 0 raise Gem::SystemExitException, status end end
Version data entries
12 entries across 12 versions & 2 rubygems