X7ROOT File Manager
Current Path:
/opt/alt/ruby20/lib64/ruby/gems/2.0.0/gems/rack-1.6.4/lib/rack
opt
/
alt
/
ruby20
/
lib64
/
ruby
/
gems
/
2.0.0
/
gems
/
rack-1.6.4
/
lib
/
rack
/
ðŸ“
..
ðŸ“
auth
ðŸ“
backports
📄
body_proxy.rb
(958 B)
📄
builder.rb
(4.27 KB)
📄
cascade.rb
(1.34 KB)
📄
chunked.rb
(1.58 KB)
📄
commonlogger.rb
(2.28 KB)
📄
conditionalget.rb
(2.5 KB)
📄
config.rb
(379 B)
📄
content_length.rb
(840 B)
📄
content_type.rb
(670 B)
📄
deflater.rb
(4.57 KB)
📄
directory.rb
(4.2 KB)
📄
etag.rb
(2.11 KB)
📄
file.rb
(4.09 KB)
ðŸ“
handler
📄
handler.rb
(3.25 KB)
📄
head.rb
(484 B)
📄
lint.rb
(29.26 KB)
📄
lobster.rb
(1.97 KB)
📄
lock.rb
(601 B)
📄
logger.rb
(357 B)
📄
methodoverride.rb
(1.01 KB)
📄
mime.rb
(30.94 KB)
📄
mock.rb
(5.68 KB)
ðŸ“
multipart
📄
multipart.rb
(1.14 KB)
📄
nulllogger.rb
(951 B)
📄
recursive.rb
(1.73 KB)
📄
reloader.rb
(2.97 KB)
📄
request.rb
(12.59 KB)
📄
response.rb
(4.33 KB)
📄
rewindable_input.rb
(3.19 KB)
📄
runtime.rb
(961 B)
📄
sendfile.rb
(5.18 KB)
📄
server.rb
(10.8 KB)
ðŸ“
session
📄
showexceptions.rb
(11.7 KB)
📄
showstatus.rb
(3.46 KB)
📄
static.rb
(4.88 KB)
📄
tempfile_reaper.rb
(670 B)
📄
urlmap.rb
(2.46 KB)
ðŸ“
utils
📄
utils.rb
(20.86 KB)
Editing: handler.rb
module Rack # *Handlers* connect web servers with Rack. # # Rack includes Handlers for Thin, WEBrick, FastCGI, CGI, SCGI # and LiteSpeed. # # Handlers usually are activated by calling <tt>MyHandler.run(myapp)</tt>. # A second optional hash can be passed to include server-specific # configuration. module Handler def self.get(server) return unless server server = server.to_s unless @handlers.include? server load_error = try_require('rack/handler', server) end if klass = @handlers[server] klass.split("::").inject(Object) { |o, x| o.const_get(x) } else const_get(server, false) end rescue NameError => name_error raise load_error || name_error end # Select first available Rack handler given an `Array` of server names. # Raises `LoadError` if no handler was found. # # > pick ['thin', 'webrick'] # => Rack::Handler::WEBrick def self.pick(server_names) server_names = Array(server_names) server_names.each do |server_name| begin return get(server_name.to_s) rescue LoadError, NameError end end raise LoadError, "Couldn't find handler for: #{server_names.join(', ')}." end def self.default(options = {}) # Guess. if ENV.include?("PHP_FCGI_CHILDREN") # We already speak FastCGI options.delete :File options.delete :Port Rack::Handler::FastCGI elsif ENV.include?(REQUEST_METHOD) Rack::Handler::CGI elsif ENV.include?("RACK_HANDLER") self.get(ENV["RACK_HANDLER"]) else pick ['thin', 'puma', 'webrick'] end end # Transforms server-name constants to their canonical form as filenames, # then tries to require them but silences the LoadError if not found # # Naming convention: # # Foo # => 'foo' # FooBar # => 'foo_bar.rb' # FooBAR # => 'foobar.rb' # FOObar # => 'foobar.rb' # FOOBAR # => 'foobar.rb' # FooBarBaz # => 'foo_bar_baz.rb' def self.try_require(prefix, const_name) file = const_name.gsub(/^[A-Z]+/) { |pre| pre.downcase }. gsub(/[A-Z]+[^A-Z]/, '_\&').downcase require(::File.join(prefix, file)) nil rescue LoadError => error error end def self.register(server, klass) @handlers ||= {} @handlers[server.to_s] = klass.to_s end autoload :CGI, "rack/handler/cgi" autoload :FastCGI, "rack/handler/fastcgi" autoload :Mongrel, "rack/handler/mongrel" autoload :EventedMongrel, "rack/handler/evented_mongrel" autoload :SwiftipliedMongrel, "rack/handler/swiftiplied_mongrel" autoload :WEBrick, "rack/handler/webrick" autoload :LSWS, "rack/handler/lsws" autoload :SCGI, "rack/handler/scgi" autoload :Thin, "rack/handler/thin" register 'cgi', 'Rack::Handler::CGI' register 'fastcgi', 'Rack::Handler::FastCGI' register 'mongrel', 'Rack::Handler::Mongrel' register 'emongrel', 'Rack::Handler::EventedMongrel' register 'smongrel', 'Rack::Handler::SwiftipliedMongrel' register 'webrick', 'Rack::Handler::WEBrick' register 'lsws', 'Rack::Handler::LSWS' register 'scgi', 'Rack::Handler::SCGI' register 'thin', 'Rack::Handler::Thin' end end
Upload File
Create Folder