Sha256: 83a70ef58c4c889e4c9fee81829897afeeef4cfa7b1a8d9e268dbc0a9792a9f8

Contents?: true

Size: 755 Bytes

Versions: 42

Compression:

Stored size: 755 Bytes

Contents

require "thin"
require "rack/content_length"
require "rack/chunked"

module Rack
  module Handler
    class Thin
      def self.run(app, options={})
        host = options.delete(:Host) || '0.0.0.0'
        port = options.delete(:Port) || 8080
        args = [host, port, app, options]
        # Thin versions below 0.8.0 do not support additional options
        args.pop if ::Thin::VERSION::MAJOR < 1 && ::Thin::VERSION::MINOR < 8
        server = ::Thin::Server.new(*args)
        yield server if block_given?
        server.start
      end

      def self.valid_options
        {
          "Host=HOST" => "Hostname to listen on (default: localhost)",
          "Port=PORT" => "Port to listen on (default: 8080)",
        }
      end
    end
  end
end

Version data entries

42 entries across 37 versions & 11 rubygems

Version Path
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/rack-1.5.5/lib/rack/handler/thin.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/rack-1.5.5/lib/rack/handler/thin.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/rack-1.5.5/lib/rack/handler/thin.rb
rack-1.5.5 lib/rack/handler/thin.rb
rack-1.5.4 lib/rack/handler/thin.rb
rack-1.5.3 lib/rack/handler/thin.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/handler/thin.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/handler/thin.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/handler/thin.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/rack-1.5.2/lib/rack/handler/thin.rb
nanumfont-rails-0.1 vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/handler/thin.rb
scout_realtime-1.0.5 lib/vendor/rack-1.5.2/lib/rack/handler/thin.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/thin.rb
scout_realtime-1.0.4 lib/vendor/rack-1.5.2/lib/rack/handler/thin.rb
scout_realtime-1.0.3 lib/vendor/rack-1.5.2/lib/rack/handler/thin.rb
scout_realtime-1.0.3.pre lib/vendor/rack-1.5.2/lib/rack/handler/thin.rb
scout_realtime-1.0.2 lib/vendor/rack-1.5.2/lib/rack/handler/thin.rb
scout_realtime-1.0.1 lib/vendor/rack-1.5.2/lib/rack/handler/thin.rb
scout_realtime-1.0.0 lib/vendor/rack-1.5.2/lib/rack/handler/thin.rb
scout_realtime-0.5.5 lib/vendor/rack-1.5.2/lib/rack/handler/thin.rb