Class: GamesParadise::Commandline

Inherits:
Base
  • Object
show all
Defined in:
lib/games_paradise/commandline/commandline.rb

Constant Summary

Constants inherited from Base

Base::CONTROL_C_CODE, Base::N

Instance Method Summary collapse

Methods inherited from Base

#cat, #commandline_arguments?, #efancy, #eparse, #first_argument?, #forestgreen, #gold, #lightblue, #lightgreen, #mediumorchid, #mediumslateblue, #opnn, #peru, #register_sigint, #reset, #rev, #royalblue, #set_commandline_arguments, #sfile, #steelblue, #teal, #tomato, #yellow

Methods included from BaseModule

#cliner, #commandline_arguments?, #first_argument?, #infer_the_namespace, #namespace?, #rename_file, #reset_the_internal_hash, #return_pwd, #set_commandline_arguments

Constructor Details

#initialize(i = ARGV) ⇒ Commandline

#

initialize

#


24
25
26
27
28
29
30
# File 'lib/games_paradise/commandline/commandline.rb', line 24

def initialize(
    i = ARGV
  )
  reset
  set_commandline_arguments(i)
  run
end

Instance Method Details

#do_start_vier_gewinntObject

#

do_start_vier_gewinnt

#


67
68
69
70
# File 'lib/games_paradise/commandline/commandline.rb', line 67

def do_start_vier_gewinnt
  require 'games_paradise/vier_gewinnt/vier_gewinnt.rb'
  GamesParadise::VierGewinnt.new(ARGV)
end
#

menu (menu tag)

#


42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/games_paradise/commandline/commandline.rb', line 42

def menu(
    i = commandline_arguments?
  )
  if i.is_a? Array
    i.each {|entry| menu(entry) }
  else
    case i # case tag
    # ===================================================================== #
    # === games_paradise --vier-gewinnt
    # ===================================================================== #
    when /-?-?vier(-|_| )?gewinnt?$/i
      do_start_vier_gewinnt
    # ===================================================================== #
    # === games_paradise --help
    # ===================================================================== #
    when /-?-?help$/i
      show_help
      exit
    end
  end
end

#runObject

#

run

#


75
76
77
# File 'lib/games_paradise/commandline/commandline.rb', line 75

def run
  menu(commandline_arguments?)
end

#show_helpObject

#

show_help

#


35
36
37
# File 'lib/games_paradise/commandline/commandline.rb', line 35

def show_help
  e 'No help options are documented so far for this class.'
end