Module: Tufte::CLI

Defined in:
lib/tufte/cli.rb

Class Method Summary collapse

Class Method Details

.run(command) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/tufte/cli.rb', line 5

def self.run(command)
  case command
  when "init"
    Tufte.init
  when "build"
    Tufte.build
  when "serve"
    require "rack"
    Rack::Server.start
  when "version", "-v", "--version"
    puts Tufte::VERSION
  else
    puts "Usage: tufte [command]\nCommands:\n  init             Scaffold a new blog in the current directory\n  build            Generate HTML pages based on the templates\n  serve            Start a development server to host your files locally\n  version          Print the current version\n  help             Print this message\n    USAGE\n  end\nend\n"