class Slideparts::Commands::Server

Public Class Methods

options() click to toggle source
# File lib/slideparts/commands/server.rb, line 9
def options
  {
    port: ["-p [ARGV]", "--port [ARGV]"]
  }
end
process(args, options = {}) click to toggle source
# File lib/slideparts/commands/server.rb, line 15
def process(args, options = {})
  server = WEBrick::HTTPServer.new({
    :DocumentRoot => '_slide',
    :Port => options[:port] || 3000
  })
  trap(:INT){server.shutdown}
  server.start
end
syntax() click to toggle source
# File lib/slideparts/commands/server.rb, line 5
def syntax
  ["s", "serve", "server"]
end