Sha256: b8ea546f690f97f07dc99dbcc61901323c166dddef3fb80e86d15446c78b713f
Contents?: true
Size: 389 Bytes
Versions: 26
Compression:
Stored size: 389 Bytes
Contents
#!/usr/bin/env ruby require 'tins/go' include Tins::GO require 'webrick' $opts = go 'p:h' if $opts[?h] puts <<USAGE #{File.basename($0)} [OPTIONS] [DIR] USAGE exit end port = ($opts[?p] || 8888).to_i s = WEBrick::HTTPServer.new( Port: port, DocumentRoot: ARGV.shift || Dir.pwd ) trap('INT') { s.shutdown } puts "You have been served: http://localhost:#{port}/" s.start
Version data entries
26 entries across 26 versions & 1 rubygems