Class: CourseGen::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/coursegen/cli.rb

Instance Method Summary collapse

Instance Method Details

#compileObject



22
23
24
# File 'lib/coursegen/cli.rb', line 22

def compile
  run("nanoc compile")
end

#deployObject



43
44
45
# File 'lib/coursegen/cli.rb', line 43

def deploy
  run "s3cmd sync --delete-removed output/ s3://#{AWS_BUCKET}/"
end

#new(course) ⇒ Object



10
11
12
# File 'lib/coursegen/cli.rb', line 10

def new(course)
  run("nanoc create-site #{course}")
end

#prepareObject



15
16
17
18
19
# File 'lib/coursegen/cli.rb', line 15

def prepare
  check_valid_directory
  tplt = CourseGen::Templates.new
  tplt.generate_all
end

#resetObject



32
33
34
35
# File 'lib/coursegen/cli.rb', line 32

def reset
  run "rm -frd tmp"
  run "rm -frd output"
end

#serveObject



27
28
29
# File 'lib/coursegen/cli.rb', line 27

def serve
  run("nanoc view")
end

#viewObject



38
39
40
# File 'lib/coursegen/cli.rb', line 38

def view
  run "open http://0.0.0.0:3000"
end