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



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

def compile
  run("nanoc compile")
end

#deployObject



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

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

#new(course) ⇒ Object



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

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

#prepareObject



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

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

#resetObject



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

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

#serveObject



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

def serve
  run("nanoc view")
end

#viewObject



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

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