Module: Cyborg::Help
Instance Method Summary collapse
- #banner(command = nil) ⇒ Object
- #build ⇒ Object
- #commands ⇒ Object
- #help ⇒ Object
- #init ⇒ Object
- #npm ⇒ 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: #{commands.values.join("\n ")} For help with a specific command, run `cyborg help command` Options: HERE elsif commands[command.to_sym] "\nUsage: #{commands[command.to_sym]}\n\nOptions:\n" end end |
#build ⇒ Object
38 39 40 |
# File 'lib/cyborg/command/help.rb', line 38 def build "cyborg build [options] # Build assets" end |
#commands ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/cyborg/command/help.rb', line 20 def commands { init: init, npm: npm, build: build, watch: watch, help: help } end |
#help ⇒ Object
46 47 48 |
# File 'lib/cyborg/command/help.rb', line 46 def help "cyborg help [command] # Show help for a specific command" end |
#init ⇒ Object
30 31 32 |
# File 'lib/cyborg/command/help.rb', line 30 def init "cyborg init [path] # Write default config file" end |
#npm ⇒ Object
34 35 36 |
# File 'lib/cyborg/command/help.rb', line 34 def npm "cyborg npm [path] # Add NPM dependencies (path: dir with package.json, defaults to '.')" end |
#watch ⇒ Object
42 43 44 |
# File 'lib/cyborg/command/help.rb', line 42 def watch "cyborg watch [options] # Build assets when files change" end |