Sha256: 5b66f2481e9daf5a97c0a273f8996ff903d8f1370343929a61edc8125f851c2a
Contents?: true
Size: 906 Bytes
Versions: 5
Compression:
Stored size: 906 Bytes
Contents
#!/usr/bin/env ruby require 'optparse' require 'ostruct' require 'addressable/uri' uri = Addressable::URI.parse('http://127.0.0.1:1234') options = OpenStruct.new options.listen = uri options.verbose = false OptionParser.new do |opts| opts.banner = 'Usage: script/start [options]' opts.on('-p PORT', '--port PORT', 'Port to listen on') do |p| options.listen.port = p end opts.on('-h HOST', '--host HOST', 'Host to listen on') do |h| options.listen.host = h end opts.on('-v', '--verbose', 'Verbose mode') do |_h| options.verbose = true end end.parse! launchy_pid = fork do system("bundle exec launchy #{options.listen}") end Process.waitpid(launchy_pid) command = [] command << 'bundle exec' command << 'middleman server' command << "-p #{options.listen.port}" command << "-h #{options.listen.host}" command << '--verbose' if options.verbose system(command.join(' '))
Version data entries
5 entries across 5 versions & 2 rubygems