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:
  #{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

#buildObject



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

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

#commandsObject



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

#helpObject



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

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

#initObject



30
31
32
# File 'lib/cyborg/command/help.rb', line 30

def init
  "cyborg init [path]        # Write default config file"
end

#npmObject



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

#watchObject



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

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