Module: Cyborg::Help
Instance Method Summary collapse
- #banner(command = nil) ⇒ Object
- #build ⇒ Object
- #clean ⇒ Object
- #command_list ⇒ Object
- #commands(command) ⇒ Object
- #gem_build ⇒ Object
- #gem_install ⇒ Object
- #gem_release ⇒ Object
- #help ⇒ Object
- #new ⇒ Object
- #server ⇒ Object
- #watch ⇒ Object
Instance Method Details
#banner(command = nil) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/cyborg/command/help.rb', line 5 def (command=nil) if command.nil? <<-HERE Commands: #{command_list.map{|c| commands(c) }.join("\n ")} For help with a specific command, run `cyborg help command` Options: HERE elsif commands(command) "\nUsage:\n cyborg #{commands(command)}\n\nOptions:\n" end end |
#build ⇒ Object
42 43 44 |
# File 'lib/cyborg/command/help.rb', line 42 def build "build [options] # Build assets" end |
#clean ⇒ Object
54 55 56 |
# File 'lib/cyborg/command/help.rb', line 54 def clean "clean # Remove cache files" end |
#command_list ⇒ Object
20 21 22 |
# File 'lib/cyborg/command/help.rb', line 20 def command_list %w(new build watch server help gem:build gem:install gem:release) end |
#commands(command) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cyborg/command/help.rb', line 24 def commands(command) case command when 'new', 'n'; new when 'build', 'b'; build when 'watch', 'w'; watch when 'server', 's'; server when 'clean', 'c'; clean when 'help', 'h'; help when 'gem:build'; gem_build when 'gem:install'; gem_install when 'gem:release'; gem_release end end |
#gem_build ⇒ Object
62 63 64 |
# File 'lib/cyborg/command/help.rb', line 62 def gem_build "gem:build # Build assets for production and build gem" end |
#gem_install ⇒ Object
66 67 68 |
# File 'lib/cyborg/command/help.rb', line 66 def gem_install "gem:install # Build assets for production, build, and install gem" end |
#gem_release ⇒ Object
70 71 72 |
# File 'lib/cyborg/command/help.rb', line 70 def gem_release "gem:release # Build assets for production, build, and release gem to rubygems.org" end |
#help ⇒ Object
58 59 60 |
# File 'lib/cyborg/command/help.rb', line 58 def help "help [command] # Show help for a specific command" end |
#new ⇒ Object
38 39 40 |
# File 'lib/cyborg/command/help.rb', line 38 def new "new <project_name> # Create a new Cyborg project" end |
#server ⇒ Object
50 51 52 |
# File 'lib/cyborg/command/help.rb', line 50 def server "server [options] # Serve documentation site" end |
#watch ⇒ Object
46 47 48 |
# File 'lib/cyborg/command/help.rb', line 46 def watch "watch [options] # Build assets when files change" end |