Sha256: 9426a27d2bc7601e6a8bf53ca35900a5f921ed8588609c088cb57bac319f7de6

Contents?: true

Size: 502 Bytes

Versions: 20

Compression:

Stored size: 502 Bytes

Contents

require 'webrick'

module Awestruct
  module Commands

    WEBrick::HTTPUtils::DefaultMimeTypes.store('atom', 'application/atom+xml')

    class Server
      attr_reader :server

      def initialize(path, bind_addr='0.0.0.0', port=4242)
        @path      = path
        @bind_addr = bind_addr
        @port      = port
      end

      def run
        @server = WEBrick::HTTPServer.new( :DocumentRoot=>@path, :Port=>@port, :BindAddress=>@bind_addr )
        @server.start
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
awestruct-0.2.11 lib/awestruct/commands/server.rb
awestruct-0.2.10 lib/awestruct/commands/server.rb
awestruct-0.2.9 lib/awestruct/commands/server.rb
awestruct-0.2.8 lib/awestruct/commands/server.rb
awestruct-0.2.7 lib/awestruct/commands/server.rb
awestruct-0.2.6 lib/awestruct/commands/server.rb
awestruct-0.2.5 lib/awestruct/commands/server.rb
awestruct-0.2.4 lib/awestruct/commands/server.rb
awestruct-0.2.3 lib/awestruct/commands/server.rb
awestruct-0.2.2 lib/awestruct/commands/server.rb
awestruct-0.2.1 lib/awestruct/commands/server.rb
awestruct-0.2.0 lib/awestruct/commands/server.rb
awestruct-0.1.9 lib/awestruct/commands/server.rb
awestruct-0.1.8 lib/awestruct/commands/server.rb
awestruct-0.1.7 lib/awestruct/commands/server.rb
awestruct-0.1.6 lib/awestruct/commands/server.rb
awestruct-0.1.5 lib/awestruct/commands/server.rb
awestruct-0.1.4 lib/awestruct/commands/server.rb
awestruct-0.1.3 lib/awestruct/commands/server.rb
awestruct-0.1.2 lib/awestruct/commands/server.rb