Module: SparkEngine::Help
Instance Method Summary collapse
- #banner(command = nil) ⇒ Object
- #build ⇒ Object
- #clean ⇒ Object
- #commands(command) ⇒ Object
- #engine_commands ⇒ Object
- #gem_build ⇒ Object
- #gem_bump_major ⇒ Object
- #gem_bump_minor ⇒ Object
- #gem_bump_patch ⇒ Object
- #gem_install ⇒ Object
- #gem_release ⇒ Object
- #generate ⇒ Object
- #help ⇒ Object
- #new ⇒ Object
- #server ⇒ Object
- #spark_commands ⇒ Object
- #watch ⇒ Object
Instance Method Details
#banner(command = nil) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/spark_engine/command/help.rb', line 5 def (command=nil) if command.nil? <<-HERE General Commands (run from anywhere): #{spark_commands.map{|c| commands(c) }.join("\n ")} Engine Commands (run these from your project's directory) #{engine_commands.map{|c| commands(c) }.join("\n ")} For help with a specific command, run `spark help command` Options: HERE elsif commands(command) "\nUsage:\n spark #{commands(command)}\n\nOptions:\n" end end |
#build ⇒ Object
69 70 71 |
# File 'lib/spark_engine/command/help.rb', line 69 def build "build [options] # Build assets" end |
#clean ⇒ Object
85 86 87 |
# File 'lib/spark_engine/command/help.rb', line 85 def clean "clean # Remove cache files" end |
#commands(command) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/spark_engine/command/help.rb', line 38 def commands(command) case command when 'new', 'n'; new when 'help', 'h'; help when 'build', 'b'; build when 'watch', 'w'; watch when 'server', 's'; server when 'generate', 'g'; generate when 'clean', 'c'; clean when 'help', 'h'; help when 'gem:build'; gem_build when 'gem:install'; gem_install when 'gem:release'; gem_release when 'gem:bump:patch'; gem_bump_patch when 'gem:bump:minor'; gem_bump_minor when 'gem:bump:major'; gem_bump_major end end |
#engine_commands ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/spark_engine/command/help.rb', line 23 def engine_commands list = %w(help build watch server generate clean gem:build gem:install gem:release) begin gem 'bump' list.concat %w(gem:bump:patch gem:bump:minor gem:bump:major) rescue Gem::LoadError end list end |
#gem_build ⇒ Object
81 82 83 |
# File 'lib/spark_engine/command/help.rb', line 81 def gem_build "gem:build # Build assets for production and build gem" end |
#gem_bump_major ⇒ Object
105 106 107 |
# File 'lib/spark_engine/command/help.rb', line 105 def gem_bump_major "gem:bump:major # Bump version v0.0.0 -> v1.0.0" end |
#gem_bump_minor ⇒ Object
101 102 103 |
# File 'lib/spark_engine/command/help.rb', line 101 def gem_bump_minor "gem:bump:minor # Bump version v0.0.0 -> v0.1.0" end |
#gem_bump_patch ⇒ Object
97 98 99 |
# File 'lib/spark_engine/command/help.rb', line 97 def gem_bump_patch "gem:bump:patch # Bump version v0.0.0 -> v0.0.1" end |
#gem_install ⇒ Object
89 90 91 |
# File 'lib/spark_engine/command/help.rb', line 89 def gem_install "gem:install # Build assets for production, build, and install gem" end |
#gem_release ⇒ Object
93 94 95 |
# File 'lib/spark_engine/command/help.rb', line 93 def gem_release "gem:release # Build assets for production, build, and release gem to rubygems.org" end |
#generate ⇒ Object
65 66 67 |
# File 'lib/spark_engine/command/help.rb', line 65 def generate "generate name [options] # Generate a Component" end |
#help ⇒ Object
61 62 63 |
# File 'lib/spark_engine/command/help.rb', line 61 def help "help [command] # Show help for a specific command" end |
#new ⇒ Object
57 58 59 |
# File 'lib/spark_engine/command/help.rb', line 57 def new "new name [options] # Create a new Spark framework engine" end |
#server ⇒ Object
77 78 79 |
# File 'lib/spark_engine/command/help.rb', line 77 def server "server [options] # Serve documentation site" end |
#spark_commands ⇒ Object
34 35 36 |
# File 'lib/spark_engine/command/help.rb', line 34 def spark_commands %w(new help) end |
#watch ⇒ Object
73 74 75 |
# File 'lib/spark_engine/command/help.rb', line 73 def watch "watch [options] # Build assets when files change" end |