Sha256: c1d19d414e9045f1fc4297b98beca740ed68f6bb3c30ca9e55027b6a73dc7956
Contents?: true
Size: 756 Bytes
Versions: 7
Compression:
Stored size: 756 Bytes
Contents
# ~*~ encoding: utf-8 ~*~ require 'aladdin' require 'optparse' module Aladdin module Commands # @example # $> aladdin server path/to/lesson/root module Server # Parses the command line arguments. # @param [Array] argv command line arguments # @return [Void] def parse!(argv) opt_parser = OptionParser.new do |opts| opts.banner = "Usage: aladdin server [options] [LESSON_PATH]" end opt_parser.parse! argv end extend self Commands.register do def server(argv=ARGV, opts={}) Server.parse! argv Aladdin.launch opts.merge(from: argv[0]) rescue => e puts e.message end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems