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
22 23 24 |
# File 'lib/coursegen/cli.rb', line 22 def compile run("nanoc compile") end |
#deploy ⇒ Object
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 |
#prepare ⇒ Object
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 |
#reset ⇒ Object
32 33 34 35 |
# File 'lib/coursegen/cli.rb', line 32 def reset run "rm -frd tmp" run "rm -frd output" end |
#serve ⇒ Object
27 28 29 |
# File 'lib/coursegen/cli.rb', line 27 def serve run("nanoc view") end |
#view ⇒ Object
38 39 40 |
# File 'lib/coursegen/cli.rb', line 38 def view run "open http://0.0.0.0:3000" end |