Sha256: d71e3c4b57c57ae4aa05cef4196db728f6eb16c0add79c4eb8e4ba40fd586e96

Contents?: true

Size: 811 Bytes

Versions: 11

Compression:

Stored size: 811 Bytes

Contents

#!/usr/bin/env ruby

require 'optparse'

begin
  OptionParser.new do |opts|
    opts.banner = "Usage: nephos-server [-p=port] [--debug]"

    $server_port = ENV["SERVER_PORT"] || 8080
    opts.on("-p=nb", "--port=nb", "Port") do |port|
      $server_port = Integer(port)
    end

    opts.on("--debug") do
      $debug = true
    end

  end.parse!

  if $debug
    require_relative "../lib/nephos-server"
  else
    require 'nephos-server'
  end

  if not $debug and
    (not File.exists? "Gemfile.lock" or
     not File.read("Gemfile.lock").split.index("nephos-server"))
    raise InvalidApplication
  end

  Nephos::Server.start($server_port)

rescue RoutingError => err
  puts "#{err.class}. Check out the documentation and `routes.rb` file: #{err.message}"

rescue => err
  puts "Error: #{err.message}"
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nephos-server-0.4.1 bin/nephos-server
nephos-server-0.4.0 bin/nephos-server
nephos-server-0.3.2 bin/nephos-server
nephos-server-0.3.1 bin/nephos-server
nephos-server-0.2.4 bin/nephos-server
nephos-server-0.2.3 bin/nephos-server
nephos-server-0.2.2 bin/nephos-server
nephos-server-0.2.0 bin/nephos-server
nephos-server-0.1.12 bin/nephos-server
nephos-server-0.1.11 bin/nephos-server
nephos-server-0.1.10 bin/nephos-server