Class: CourseGen::CLI
- Inherits:
-
Thor
- Object
- Thor
- CourseGen::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/coursegen/cli.rb
Instance Method Summary collapse
- #compile ⇒ Object
- #deploy ⇒ Object
- #new(course) ⇒ Object
- #prepare ⇒ Object
- #reset ⇒ Object
- #serve ⇒ Object
- #view ⇒ Object
Instance Method Details
#compile ⇒ Object
23 24 25 |
# File 'lib/coursegen/cli.rb', line 23 def compile run("nanoc compile") end |
#deploy ⇒ Object
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 |
#prepare ⇒ Object
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 |
#reset ⇒ Object
33 34 35 36 |
# File 'lib/coursegen/cli.rb', line 33 def reset run "rm -frd tmp" run "rm -frd output" end |
#serve ⇒ Object
28 29 30 |
# File 'lib/coursegen/cli.rb', line 28 def serve run("nanoc view") end |
#view ⇒ Object
39 40 41 |
# File 'lib/coursegen/cli.rb', line 39 def view run "open http://0.0.0.0:3000" end |