Sha256: 849ee249f9db5622256330fe51c2d928095b48d388ba7f3474ac1e53b8ac4b7b
Contents?: true
Size: 593 Bytes
Versions: 6
Compression:
Stored size: 593 Bytes
Contents
require 'hara/base' start_options = {host: 'localhost', port: 3210} #like sinatra.. if ARGV.any? require 'optparse' OptionParser.new { |op| op.on('-p port', "set the port (default is #{start_options[:port]})") { |val| start_options[:port] = val.to_i } op.on('-o addr', "set the host (default is #{start_options[:host]})") { |val| srart_options[:host] = val } op.on('-e env', 'set the environment (default is development)') { |val| Hara.env = val.to_sym } }.parse!(ARGV.dup) end at_exit { Hara::Server.start(start_options[:host], start_options[:port]) if $!.nil? }
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
hara-0.2.2 | lib/hara/main.rb |
hara-0.2.1 | lib/hara/main.rb |
hara-0.2.0 | lib/hara/main.rb |
hara-0.1.0 | lib/hara/main.rb |
hara-0.0.2 | lib/hara/main.rb |
hara-0.0.1 | lib/hara/main.rb |