Class: GamesAndRpgParadise::Commandline
- Inherits:
-
Base
- Object
- Base
- GamesAndRpgParadise::Commandline
show all
- Defined in:
- lib/games_and_rpg_paradise/commandline/commandline.rb
Overview
GamesAndRpgParadise::Commandline
Constant Summary
Base::Extensions::Colours::ARRAY_AVAILABLE_KONSOLE_COLOURS
GamesAndRpgParadise::CommonExtensions::CONTROL_C_CODE, GamesAndRpgParadise::CommonExtensions::N
Instance Method Summary
collapse
ecomment, #efancy, #eparse, #forestgreen, #gold, #grey, #lightblue, #mediumseagreen, #mediumslateblue, #peru, #rev, sdir, sfancy, #sfile, simp, #teal, #yellow
#commandline_arguments?, #filter_away_commandline_arguments, #first_argument?, #first_non_hyphened_argument?, #set_commandline_arguments
#cat, #cd, #cliner, #copy_file, #delete, #dirname_but_retains_the_trailing_slash, #disable_colours, #ensure_that_the_log_directory_exists, #esystem, #get_user_input, #infer_the_namespace, #is_on_roebe?, #log_dir?, #mkdir, #mkdir_then_cd_into_it, #mv, #namespace?, #opne, #opnn, #project_base_directory?, #project_image_directory?, #project_yaml_directory?, #rds, #register_sigint, #remove_this_directory, #rename_file, #reset, #reset_the_internal_hash, #return_pwd, #return_today, #touch_file, #wrap, #write_what_into
Constructor Details
#initialize(i = ARGV, run_already = true) ⇒ Commandline
27
28
29
30
31
32
33
34
|
# File 'lib/games_and_rpg_paradise/commandline/commandline.rb', line 27
def initialize(
i = ARGV,
run_already = true
)
reset
set_commandline_arguments(i)
run if run_already
end
|
Instance Method Details
#do_start_vier_gewinnt ⇒ Object
#
do_start_vier_gewinnt
#
112
113
114
115
|
# File 'lib/games_and_rpg_paradise/commandline/commandline.rb', line 112
def do_start_vier_gewinnt
require 'games_and_rpg_paradise/games/vier_gewinnt/vier_gewinnt.rb'
GamesAndRpgParadise::VierGewinnt.new(ARGV)
end
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
# File 'lib/games_and_rpg_paradise/commandline/commandline.rb', line 50
def (
i = commandline_arguments?
)
if i.is_a? Array
if i.empty?
output_complete_random_male_tai_name else
i.each {|entry|
(entry)
}
end
else
case i when /-?-?g?e?n?(-|_| )?gamebook\d{1,3}$/
RpgParadise::GenerateHtmlGamebook.new(i)
exit
when /-?-?create(-|_| )?static(-|_| )?html(-|_| )?file(-|_| )?for=(\d+)$/i RpgParadise::GenerateHtmlGamebook.new($5) { :single }
exit
when /-?-?vier(-|_| )?gewinnt?$/i
do_start_vier_gewinnt
when /-?-?help$/i
show_help
exit
else
if i.include? '--'
e "Unknown entry: #{i}"
else
output_complete_random_male_tai_name
end
end
end
end
|
#output_complete_random_male_tai_name ⇒ Object
#
output_complete_random_male_tai_name
#
103
104
105
106
107
|
# File 'lib/games_and_rpg_paradise/commandline/commandline.rb', line 103
def output_complete_random_male_tai_name
e ::Colours.tomato(
RpgParadise::Sarlem::Tai.complete_random_male_tai_name
)
end
|
#run ⇒ Object
120
121
122
|
# File 'lib/games_and_rpg_paradise/commandline/commandline.rb', line 120
def run
(commandline_arguments?)
end
|
#show_help ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/games_and_rpg_paradise/commandline/commandline.rb', line 39
def show_help
e
e ' --create-static-html-file-for=3 # create a static '\
'HTML file for the third gamebook'
e ' --vier-gewinnt # start the game "vier gewinnt"'
e
end
|