Sha256: 7318db0742a4f8954fbb825185e0b178ef78a508a798cce35d75d5f1e04a7ac2

Contents?: true

Size: 848 Bytes

Versions: 4

Compression:

Stored size: 848 Bytes

Contents

require 'rack'

module Dugway
  module Cli
    class Server < Thor::Group      
      class_option :host,
        :type    => :string,
        :aliases => '-h',
        :default => '0.0.0.0',
        :desc    => 'The host address to bind to'
      
      class_option :port,
        :type    => :numeric,
        :aliases => '-p',
        :default => 9292,
        :desc    => "The port address to bind to"

      class_option :server,
        :type    => :string,
        :aliases => '-s',
        :default => 'thin',
        :desc    => "Which server to run"
      
      def start
        Rack::Server.start({
          :config => File.join(Dir.pwd, 'config.ru'),
          :environment => 'none',
          :Host => options[:host],
          :Port => options[:port],
          :server => options[:server]
        })
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dugway-0.5.6 lib/dugway/cli/server.rb
dugway-0.5.4 lib/dugway/cli/server.rb
dugway-0.5.3 lib/dugway/cli/server.rb
dugway-0.5.2 lib/dugway/cli/server.rb