Module: MonoclePrint
- Included in:
- Graphics, OutputDevice, Presentation, SingleLine, Table, Table::Column, Table::Member, Table::Segments, Text
- Defined in:
- lib/monocle-print/terminal-escapes.rb,
lib/monocle-print.rb,
lib/monocle-print/list.rb,
lib/monocle-print/table.rb,
lib/monocle-print/utils.rb,
lib/monocle-print/atomic.rb,
lib/monocle-print/layout.rb,
lib/monocle-print/geometry.rb,
lib/monocle-print/graphics.rb,
lib/monocle-print/progress.rb,
lib/monocle-print/presentation.rb,
lib/monocle-print/table/column.rb,
lib/monocle-print/output-device.rb,
lib/monocle-print/table/members.rb,
lib/monocle-print/table/segments.rb
Overview
require ‘termios’ require ‘terminfo’
Defined Under Namespace
Modules: Presentation, TerminalEscapes, Utils
Classes: ColumnLayout, Flow, Graphics, Horizontal, Layout, List, OutputDevice, Pager, Pair, Progress, Rectangle, SingleLine, Table, Text, Vertical
Constant Summary
collapse
- VERSION =
'1.0.2'
- MULTIBYTE_CHARACTER =
%r<
[\xC2-\xDF][\x80-\xBF]
| [\xE0-\xEF][\x80-\xBF]{2}
| [\xF0-\xF4][\x80-\xBF]{3}
>x
- ONE_BYTE =
0x20 .. 0x7E
- TWO_BYTES =
0xC2 .. 0xDF
- THREE_BYTES =
0xE0 .. 0xEF
- FOUR_BYTES =
0xF0 .. 0xF4
- COLOR_ESCAPE =
/\e\[[\d:;]*?m/
Class Method Summary
collapse
Class Method Details
.buffer(options = {}, &block) ⇒ Object
34
35
36
|
# File 'lib/monocle-print.rb', line 34
def self.buffer( options = {}, &block )
OutputDevice.buffer( options, &block )
end
|
.included(kl) ⇒ Object
17
18
19
20
|
# File 'lib/monocle-print.rb', line 17
def self.included( kl )
super
kl.extend( self )
end
|
.library_path(*args) ⇒ Object
22
23
24
|
# File 'lib/monocle-print.rb', line 22
def self.library_path( *args )
File.join( File.dirname( __FILE__ ), *args )
end
|
.Line(obj) ⇒ Object
40
41
42
|
# File 'lib/monocle-print.rb', line 40
def Line( obj )
SingleLine === obj ? obj : SingleLine.new( obj.to_s )
end
|
.Output(dev) ⇒ Object
44
45
46
|
# File 'lib/monocle-print.rb', line 44
def Output( dev )
OutputDevice === dev ? dev : OutputDevice.new( dev )
end
|
.Rectangle(obj) ⇒ Object
60
61
62
63
64
65
66
67
|
# File 'lib/monocle-print.rb', line 60
def Rectangle( obj )
case obj
when Rectangle then obj
when Array then Rectangle.new( *obj )
when Hash then Rectangle.create( obj )
else Rectangle.new( obj )
end
end
|
.stderr(options = {}, &block) ⇒ Object
30
31
32
|
# File 'lib/monocle-print.rb', line 30
def self.stderr( options = {}, &block )
OutputDevice.stderr( options, &block )
end
|
.stdout(options = {}, &block) ⇒ Object
26
27
28
|
# File 'lib/monocle-print.rb', line 26
def self.stdout( options = {}, &block )
OutputDevice.stdout( options, &block )
end
|
.Style(obj) ⇒ Object
56
57
58
|
# File 'lib/monocle-print.rb', line 56
def Style( obj )
Graphics === obj ? obj : Graphics::NAMED_STYLES[ obj.to_s ]
end
|
.Text(obj) ⇒ Object
48
49
50
51
52
53
54
|
# File 'lib/monocle-print.rb', line 48
def Text( obj )
case obj
when Text then obj
when nil then Text.new( '' )
else Text.new( obj.to_s )
end
end
|
.version ⇒ Object
13
14
15
|
# File 'lib/monocle-print.rb', line 13
def self.version
VERSION
end
|