Class: CourseGen::CLI
- Inherits:
-
Thor
- Object
- Thor
- CourseGen::CLI
- 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
- #compile ⇒ Object
- #deploy ⇒ Object
- #new(course) ⇒ Object
- #prepare ⇒ Object
- #reset ⇒ Object
- #serve ⇒ Object
- #view ⇒ Object
Instance Method Details
#compile ⇒ Object
43 44 45 |
# File 'lib/coursegen/cli.rb', line 43 def compile run 'nanoc compile' end |
#deploy ⇒ Object
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 |
#prepare ⇒ Object
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 |
#reset ⇒ Object
61 62 63 64 |
# File 'lib/coursegen/cli.rb', line 61 def reset run 'rm -frd tmp' run 'rm -frd output' end |
#serve ⇒ Object
54 55 56 |
# File 'lib/coursegen/cli.rb', line 54 def serve run 'nanoc view' end |
#view ⇒ Object
69 70 71 |
# File 'lib/coursegen/cli.rb', line 69 def view run 'open http://0.0.0.0:3000' end |