Class: Gloo::App::Platform
- Inherits:
 - 
      Object
      
        
- Object
 - Gloo::App::Platform
 
 
- Defined in:
 - lib/gloo/app/platform.rb
 
Constant Summary collapse
- DEFAULT_TMP_FILE =
 'tmp.txt'.freeze
Instance Attribute Summary collapse
- 
  
    
      #prompt  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute prompt.
 - 
  
    
      #table  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute table.
 
Instance Method Summary collapse
- 
  
    
      #clear_screen  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Clear the screen.
 - 
  
    
      #cols  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Get the number of horizontal columns on screen.
 - 
  
    
      #getColorizedString(str, color)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Get colorized string.
 - 
  
    
      #getFileMech(engine)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Get the file mechanism for this platform.
 - 
  
    
      #initialize  ⇒ Platform 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
Set up Platform.
 - 
  
    
      #lines  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
——————————————————————— Sceen helpers ———————————————————————.
 - 
  
    
      #show(msg)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Show a message.
 
Constructor Details
Instance Attribute Details
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
      16 17 18  | 
    
      # File 'lib/gloo/app/platform.rb', line 16 def prompt @prompt end  | 
  
#table ⇒ Object (readonly)
Returns the value of attribute table.
      16 17 18  | 
    
      # File 'lib/gloo/app/platform.rb', line 16 def table @table end  | 
  
Instance Method Details
#clear_screen ⇒ Object
Clear the screen.
      36 37 38  | 
    
      # File 'lib/gloo/app/platform.rb', line 36 def clear_screen puts "\e[H\e[2J" end  | 
  
#cols ⇒ Object
Get the number of horizontal columns on screen.
      75 76 77 78  | 
    
      # File 'lib/gloo/app/platform.rb', line 75 def cols rows, columns = $stdout.winsize return columns end  | 
  
#getColorizedString(str, color) ⇒ Object
Get colorized string.
      55 56 57 58  | 
    
      # File 'lib/gloo/app/platform.rb', line 55 def getColorizedString( str, color ) colorized = ColorizedString[ str.to_s ].colorize( color ) return colorized.to_s end  | 
  
#getFileMech(engine) ⇒ Object
Get the file mechanism for this platform.
      43 44 45  | 
    
      # File 'lib/gloo/app/platform.rb', line 43 def getFileMech( engine ) return Gloo::Persist::DiscMech.new( engine ) end  | 
  
#lines ⇒ Object
Sceen helpers
Get the number of vertical lines on screen.
      67 68 69 70  | 
    
      # File 'lib/gloo/app/platform.rb', line 67 def lines rows, columns = $stdout.winsize return rows end  | 
  
#show(msg) ⇒ Object
Show a message.
      29 30 31  | 
    
      # File 'lib/gloo/app/platform.rb', line 29 def show( msg ) puts msg end  |