Class: CourseGen::CLI

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

Overview

Class CLI provides a command line utility for creating, building, and deploying a Coursegen site.

Instance Method Summary collapse

Instance Method Details

#compileObject



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

def compile
  run 'nanoc compile'
end

#deployObject



79
80
81
# File 'lib/coursegen/cli.rb', line 79

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

#new(course) ⇒ Object



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

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

#prepareObject



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

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

#resetObject



61
62
63
64
# File 'lib/coursegen/cli.rb', line 61

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

#serveObject



54
55
56
# File 'lib/coursegen/cli.rb', line 54

def serve
  run 'nanoc view'
end

#viewObject



69
70
71
# File 'lib/coursegen/cli.rb', line 69

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