Sha256: da5a3d4f196c32e2aff0008bb6b7c889f1daa1731ae0564a899eddb858d6d744
Contents?: true
Size: 1.35 KB
Versions: 2
Compression:
Stored size: 1.35 KB
Contents
#!/usr/bin/env ruby require 'reel' require 'optparse' options = { rackup: "config.ru" } parser = OptionParser.new do |opts| opts.on "-p", "--port PORT", Integer, "Define what port TCP port to bind to (default: 3000)" do |arg| options[:port] = arg end opts.on "-a", "--address HOST", "bind to HOST address (default: 0.0.0.0)" do |arg| options[:host] = arg end opts.on "-q", "--quiet", "Quiet down the output" do options[:quiet] = true end opts.on "-e", "--environment ENVIRONMENT", "The environment to run the Rack app on (default: development)" do |arg| options[:environment] = arg end opts.on "-t", "--threads NUM", Integer, "The number of worker threads (default: 10)" do |arg| options[:workers] = arg end opts.on "-r", "--rackup FILE", "Load Rack config from this file (default: config.ru)" do |arg| options[:rackup] = arg end end parser.banner = "reel <options> <rackup file>" parser.on_tail "-h", "--help", "Show help" do puts parser exit 1 end parser.parse!(ARGV) if ARGV.last =~ /\.ru$/ options[:rackup] = ARGV.shift end unless File.exists?(options[:rackup]) abort "No rackup found at #{options[:rackup]}" end handler = Rack::Handler::Reel.new(options) Reel::Logger.info "A Reel good HTTP server!" Reel::Logger.info "Listening on #{handler[:host]}:#{handler[:port]}" handler.start sleep
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
reel-0.4.0.pre2 | bin/reel |
reel-0.4.0.pre | bin/reel |