Sha256: 6a0c5623c9119c6714b6036c59743dc9f02a44f3374cf8af644967e37b5b2da1
Contents?: true
Size: 946 Bytes
Versions: 7
Compression:
Stored size: 946 Bytes
Contents
#!/usr/bin/env ruby require 'optparse' # defaults o = { host: '0.0.0.0', port: '8777' } OptionParser.new do |opts| opts.program_name = 'wikimd' opts.banner = 'Usage: wikimd [options]' opts.on('-h', '--host HOST', "listen on HOST (default: #{o[:host]})") do |host| o[:host] = host end opts.on('-p', '--port PORT', "use PORT (default: #{o[:port]})") do |port| o[:port] = port end opts.separator '' opts.separator 'Common options:' opts.on_tail('-h', '-?', '--help', 'Show this message') do puts opts exit end opts.on_tail('-v', '--version', 'Show version') do require 'wikimd/version' puts "WikiMD #{WikiMD::VERSION}" exit end end.parse! ENV['REPO_PATH'] = File.expand_path(ARGV.any? ? ARGV.shift : '.') config_ru = File.expand_path('../../config.ru', __FILE__) ARGV.unshift '--host', o[:host], '--port', o[:port], '--env', 'production', config_ru require 'rack' Rack::Server.start
Version data entries
7 entries across 7 versions & 1 rubygems
Version | Path |
---|---|
wikimd-0.4.2 | bin/wikimd |
wikimd-0.4.1 | bin/wikimd |
wikimd-0.4.0 | bin/wikimd |
wikimd-0.3.1 | bin/wikimd |
wikimd-0.3.0 | bin/wikimd |
wikimd-0.2.0 | bin/wikimd |
wikimd-0.1.0 | bin/wikimd |