Class: CitizenCodeScripts::Help
- Inherits:
-
Base
- Object
- Base
- CitizenCodeScripts::Help
show all
- Defined in:
- lib/citizen_code_scripts/help.rb
Constant Summary
Constants included
from Colorize
Colorize::COLOR_CODES
Instance Attribute Summary
Attributes inherited from Base
#argv
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#app_names, #app_root, inherited, #initialize, load_scripts_deferred, name, run, script_classes, script_names, scripts, #staging_app_name, #step, #system!
Methods included from Colorize
#colorize, included
Class Method Details
.description ⇒ Object
10
11
12
|
# File 'lib/citizen_code_scripts/help.rb', line 10
def self.description
"Prints this message out"
end
|
.help ⇒ Object
2
3
4
|
# File 'lib/citizen_code_scripts/help.rb', line 2
def self.help
"Inception was a lame movie"
end
|
.help_subcommands ⇒ Object
6
7
8
|
# File 'lib/citizen_code_scripts/help.rb', line 6
def self.help_subcommands
{}
end
|
Instance Method Details
#run ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/citizen_code_scripts/help.rb', line 14
def run
specific_script = argv[0]
if CitizenCodeScripts::Base.script_names.include?(specific_script)
script = CitizenCodeScripts::Base.scripts[specific_script]
puts full_help(script)
elsif specific_script
puts colorize(:red, "\"#{specific_script}\" does not exist, cannot display help")
else
basic_usage
end
end
|