Module: SparkEngine::Help

Extended by:
Help
Included in:
Help
Defined in:
lib/spark_engine/command/help.rb

Instance Method Summary collapse

Instance Method Details



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 banner(command=nil)
  if command.nil?
    "General Commands (run from anywhere):\n  \#{spark_commands.map{|c| commands(c) }.join(\"\\n  \")}\n\nEngine Commands (run these from your project's directory)\n  \#{engine_commands.map{|c| commands(c) }.join(\"\\n  \")}\n\nFor help with a specific command, run `spark help command`\n\nOptions:\n    HERE\n  elsif commands(command)\n    \"\\nUsage:\\n  spark \#{commands(command)}\\n\\nOptions:\\n\"\n  end\nend\n"

#buildObject



64
65
66
# File 'lib/spark_engine/command/help.rb', line 64

def build
  "build [options]      # Build assets"
end

#cleanObject



76
77
78
# File 'lib/spark_engine/command/help.rb', line 76

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
# 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 '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_commandsObject



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 help 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_buildObject



84
85
86
# File 'lib/spark_engine/command/help.rb', line 84

def gem_build
  "gem:build            # Build assets for production and build gem"
end

#gem_bump_majorObject



104
105
106
# File 'lib/spark_engine/command/help.rb', line 104

def gem_bump_major
  "gem:bump:major       # Upgrade v0.0.0 -> v1.0.0 and build assets"
end

#gem_bump_minorObject



100
101
102
# File 'lib/spark_engine/command/help.rb', line 100

def gem_bump_minor
  "gem:bump:minor       # Upgrade v0.0.0 -> v0.1.0 and build assets"
end

#gem_bump_patchObject



96
97
98
# File 'lib/spark_engine/command/help.rb', line 96

def gem_bump_patch
  "gem:bump:patch       # Upgrade v0.0.0 -> v0.0.1 and build assets"
end

#gem_installObject



88
89
90
# File 'lib/spark_engine/command/help.rb', line 88

def gem_install
  "gem:install          # Build assets for production, build, and install gem"
end

#gem_releaseObject



92
93
94
# File 'lib/spark_engine/command/help.rb', line 92

def gem_release
  "gem:release          # Build assets for production, build, and release gem to rubygems.org"
end

#helpObject



60
61
62
# File 'lib/spark_engine/command/help.rb', line 60

def help
  "help [command]       # Show help for a specific command"
end

#newObject



56
57
58
# File 'lib/spark_engine/command/help.rb', line 56

def new
  "new name [options]   # Create a new Spark framework engine"
end

#serverObject



72
73
74
# File 'lib/spark_engine/command/help.rb', line 72

def server
  "server [options]     # Serve documentation site"
end

#spark_commandsObject



34
35
36
# File 'lib/spark_engine/command/help.rb', line 34

def spark_commands
  %w(new help)
end

#watchObject



68
69
70
# File 'lib/spark_engine/command/help.rb', line 68

def watch
  "watch [options]      # Build assets when files change"
end