Class: Bovem::Console
- Inherits:
-
Object
- Object
- Bovem::Console
- Includes:
- Bovem::ConsoleMethods::Interactions, Bovem::ConsoleMethods::Logging, Bovem::ConsoleMethods::Output, Bovem::ConsoleMethods::StyleHandling, Lazier::I18n
- Defined in:
- lib/bovem/console.rb
Overview
This is a text utility wrapper console I/O.
Instance Attribute Summary (collapse)
-
- (Fixnum) indentation
Current indentation width.
-
- (String) indentation_string
The string used for indentation.
-
- (Fixnum) line_width
The line width.
-
- (Fixnum) screen_width
The current screen width.
Class Method Summary (collapse)
-
+ (Console) instance
Returns a unique instance for Console.
Instance Method Summary (collapse)
-
- (Console) initialize
constructor
Initializes a new Console.
Methods included from Bovem::ConsoleMethods::Interactions
Methods included from Bovem::ConsoleMethods::Logging
#begin, #debug, #error, #fatal, #get_banner, #info, #status, #warn, #write, #write_banner_aligned
Methods included from Bovem::ConsoleMethods::Output
#format, #format_right, #get_screen_width, #indent, #reset_indentation, #set_indentation, #with_indentation, #wrap
Methods included from Bovem::ConsoleMethods::StyleHandling
Constructor Details
- (Console) initialize
Initializes a new Console.
636 637 638 639 640 641 642 |
# File 'lib/bovem/console.rb', line 636 def initialize @line_width = self.get_screen_width @indentation = 0 @indentation_string = " " @stty = ::Bovem::Console.execute("which stty").strip self.i18n_setup(:bovem, ::File.absolute_path(::Pathname.new(::File.dirname(__FILE__)).to_s + "/../../locales/")) end |
Instance Attribute Details
- (Fixnum) indentation
Current indentation width.
616 617 618 |
# File 'lib/bovem/console.rb', line 616 def indentation @indentation end |
- (String) indentation_string
The string used for indentation.
616 617 618 |
# File 'lib/bovem/console.rb', line 616 def indentation_string @indentation_string end |
- (Fixnum) line_width
The line width. Default to 80
.
616 617 618 |
# File 'lib/bovem/console.rb', line 616 def line_width @line_width end |
- (Fixnum) screen_width
The current screen width.
616 617 618 |
# File 'lib/bovem/console.rb', line 616 def screen_width @screen_width end |
Class Method Details
+ (Console) instance
Returns a unique instance for Console.
631 632 633 |
# File 'lib/bovem/console.rb', line 631 def self.instance @instance ||= ::Bovem::Console.new end |