Class: ModraUp::Console
- Inherits:
-
Object
- Object
- ModraUp::Console
Overview
Hosted in the Ruby Console. SketchUp redirects $stdout / $stderr to the single instance of SKETCHUP_CONSOLE, so plugins' p / puts / warn will write to the console window rather than the process terminal. Objects conform to the IO duck type by providing write / flush / tty?, otherwise MRI 3.2 will raise a NoMethodError when writing warnings. Writes from non-main threads will be dropped (consistent with SketchUp 2014+).
Instance Method Summary # collapse
-
#write(string) ⇒ Integer
Write the string to the console without a newline. Returns the number of bytes written. Kernel#p / Kernel#puts
-
#<< ⇒ ModraUp::Console
Like #write, returns self so that $stdout << "x" can be chained.
-
#flush ⇒ ModraUp::Console
The console has no underlying buffer and returns self with an empty operation. MRI redirects $stderr to this object, causing warnings and RubyVM::InstructionSequence.compile to call flush; without this method, the plugin require 'forwardable' will raise a NoMethodError.
-
#tty? ⇒ false
Not a terminal. Use $stdout.tty?. Go here.
-
#isatty ⇒ false
Alias for #tty?.
-
#closed? ⇒ false
The console cannot be closed and remains false.
-
#close ⇒ nil
Does nothing. The standard library sometimes calls close on $stdout.
-
#close_write ⇒ nil
Does nothing.
-
#sync ⇒ true
Unbuffered, always true.
-
#sync= ⇒ Object
Ignore the assignment and still treat it as unbuffered.
-
#show ⇒ true
Open the Ruby Console window.
-
#hide ⇒ true
Hide the Ruby Console window.
-
#clear ⇒ true
Clear the console output.
-
#visible? ⇒ Boolean
Whether the Console window is displayed.
Instance Method Details
console.write(string) ⇒ Integer
Write the string to the console without a newline. Returns the number of bytes written. Kernel#p / Kernel#puts Call this method by invoking $stdout.
console << string ⇒ console
Like #write, returns self so that $stdout << "x" can be chained.
console.flush ⇒ console
The console has no underlying buffer and returns self with an empty operation. MRI redirects $stderr to this object, causing warnings and RubyVM::InstructionSequence.compile to call flush; without this method, the plugin require 'forwardable' will raise a NoMethodError.
console.tty? ⇒ false
Not a terminal. Use $stdout.tty?. Go here.
console.isatty ⇒ false
Alias for #tty?.
console.closed? ⇒ false
The console cannot be closed and remains false.
console.close ⇒ nil
Does nothing. The standard library sometimes calls close on $stdout.
console.close_write ⇒ nil
Does nothing.
console.sync ⇒ true
Unbuffered, always true.
console.sync = value ⇒ value
Ignore the assignment and still treat it as unbuffered.
console.show ⇒ true
Open the Ruby Console window.
console.hide ⇒ true
Hide the Ruby Console window.
console.clear ⇒ true
Clear the console output.
console.visible? ⇒ Boolean
Whether the Console window is displayed.