Module: Cyborg::Help

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

Instance Method Summary collapse

Instance Method Details



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/cyborg/command/help.rb', line 5

def banner(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

#buildObject



42
43
44
# File 'lib/cyborg/command/help.rb', line 42

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

#cleanObject



54
55
56
# File 'lib/cyborg/command/help.rb', line 54

def clean
  "clean                # Remove cache files"
end

#command_listObject



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_buildObject



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_installObject



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_releaseObject



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

#helpObject



58
59
60
# File 'lib/cyborg/command/help.rb', line 58

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

#newObject



38
39
40
# File 'lib/cyborg/command/help.rb', line 38

def new
  "new <project_name>   # Create a new Cyborg project"
end

#serverObject



50
51
52
# File 'lib/cyborg/command/help.rb', line 50

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

#watchObject



46
47
48
# File 'lib/cyborg/command/help.rb', line 46

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