class RBT::Controller

Public Class Methods

new( cmdline_arguments = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/controller/controller.rb, line 27
def initialize(
    cmdline_arguments = nil,
    run_already       = true
  )
  reset
  set_commandline(cmdline_arguments)
  run if run_already
end

Public Instance Methods

e_table(i) click to toggle source
#

e_table

#
# File lib/rbt/controller/controller.rb, line 84
def e_table(i)
  splitted = i.split '-'
  beautified = ( '%-15s' % splitted[0] ) +  ' - '+splitted[1]
  e "  #{beautified}"
end
feedback_help() click to toggle source
#

feedback_help

To invoke this, do:

controller fhelp
#
# File lib/rbt/controller/controller.rb, line 61
def feedback_help
  cliner {
    e "Feedbacking help from #{return_cgrey('Controller.rb')} now:#{N}"
    e
    e_table '  tobash       - generate bash shell scripts'
    e_table '  register     - register something'
    e_table '  generate     - generate a makefile'
    e_table '  graph        - run graphviz'
    e_table '  to_trad      - convert a package to traditional'
    e
  }
end
process_commandline() click to toggle source
#

process_commandline

#
# File lib/rbt/controller/controller.rb, line 93
def process_commandline
  _ = @commandline.pop
  case _ # case tag
  # ======================================================================= #
  # === beautify
  # ======================================================================= #
  when 'beautify'
    BeautifyConfigureHelpOutput.new
  # ======================================================================= #
  # === to_bash
  # ======================================================================= #
  when '1',
       'to_bash',
       'tob',
       'tobash'
    Compile.new(nil,nil,false).to_bash # the name doesnt matter here anyway.
  # ======================================================================= #
  # === help
  # ======================================================================= #
  when 'help',
       '?',
       'fhelp',
       'hel'
    feedback_help
  end
end
reset() click to toggle source
#

reset

#
Calls superclass method RBT::Base#reset
# File lib/rbt/controller/controller.rb, line 39
def reset
  super()
end
return_cgrey(i) click to toggle source
#

return_cgrey

#
# File lib/rbt/controller/controller.rb, line 77
def return_cgrey(i)
  return Colours::CGREY+i+rev
end
run() click to toggle source
#

run

#
# File lib/rbt/controller/controller.rb, line 123
def run
  process_commandline
end
set_commandline(i) click to toggle source
#

set_commandline

Use this method to set the @commandline. We can then respond to what the user instructs us to do.

#
# File lib/rbt/controller/controller.rb, line 49
def set_commandline(i)
  @commandline = i
end