Skip to content

Instantly share code, notes, and snippets.

@l3kn
Created October 4, 2013 22:07
Show Gist options
  • Save l3kn/6833629 to your computer and use it in GitHub Desktop.
Save l3kn/6833629 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'commander/import'
require 'nopoint/version'
require 'nopoint'
program :name, 'nopoint'
program :version, Nopoint::VERSION
program :description, 'Slideshow generator'
default_command :help
command :new do |c|
c.syntax = 'nopoint new PATH [options]'
c.summary = 'Scaffold a new Slide'
c.description = 'Creates a new Nopoint scaffold at $PATH'
c.action do |args, options|
Nopoint::Commands::New.process(args, options)
end
end
command :serve do |c|
c.syntax = 'nopoint serve [options]'
c.summary = 'Start a webserver'
c.description = 'Serve your slideshow locally'
c.option '-w', '--watch', 'watch for changes and rebuild'
c.action do |args, options|
# let the build command know that we are serving
options.default :serving => true
Nopoint::Commands::Build.process(options)
Nopoint::Commands::Serve.process(options)
end
end
command :build do |c|
c.syntax = 'nopoint build [options]'
c.summary = 'Generate slideshow'
c.description = 'Converts the slideshow to a static html site'
c.option '-w', '--watch', 'watch for changes and rebuild'
c.action do |args, options|
Nopoint::Commands::Build.process(options)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment