Sha256: 55aff2b629752fa263ca30b57b5071788a32e0ba127d0eaf0b1dd82c41211153

Contents?: true

Size: 689 Bytes

Versions: 2

Compression:

Stored size: 689 Bytes

Contents

#!/usr/bin/env ruby
$LOAD_PATH.push File.expand_path('../../lib', __FILE__)

require 'optparse'
require 'rubrowser'
require 'rubrowser/server'

options = {
  port: 9000,
  files: ARGV.empty? ? ['.'] : ARGV
}

OptionParser.new do |opts|
  opts.banner = "Usage: #{__FILE__} [options] [file] ..."

  message = 'Specify port number for server, default = 9000'
  opts.on('-pPORT', '--port=PORT', message) do |port|
    options[:port] = port.to_i
  end

  opts.on('-v', '--version', 'Print Rubrowser version') do
    puts "Rubrowser #{Rubrowser::VERSION}"
    exit
  end

  opts.on('-h', '--help', 'Prints this help') do
    puts opts
    exit
  end
end.parse!

Rubrowser::Server.start(options)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubrowser-0.3.1 bin/rubrowser
rubrowser-0.3.0 bin/rubrowser