brew vendor-gems: commit updates.
This commit is contained in:
parent
1816bfb46b
commit
2f74401433
@ -83,7 +83,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version
|
|||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/patchelf-1.4.0/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/patchelf-1.4.0/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/plist-3.6.0/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/plist-3.6.0/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pry-0.14.1/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pry-0.14.1/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rack-3.0.1/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rack-3.0.2/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unparser-0.6.4/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unparser-0.6.4/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbi-0.0.14/lib")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rbi-0.0.14/lib")
|
||||||
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/universal-darwin-21/#{Gem.extension_api_version}/rdiscount-2.2.7")
|
$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/extensions/universal-darwin-21/#{Gem.extension_api_version}/rdiscount-2.2.7")
|
||||||
|
|||||||
@ -10,8 +10,6 @@ module Rack
|
|||||||
#
|
#
|
||||||
# Initialize with the Rack application that you want protecting,
|
# Initialize with the Rack application that you want protecting,
|
||||||
# and a block that checks if a username and password pair are valid.
|
# and a block that checks if a username and password pair are valid.
|
||||||
#
|
|
||||||
# See also: <tt>example/protectedlobster.rb</tt>
|
|
||||||
|
|
||||||
class Basic < AbstractHandler
|
class Basic < AbstractHandler
|
||||||
|
|
||||||
@ -10,26 +10,23 @@ module Rack
|
|||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
#
|
#
|
||||||
# require 'rack/lobster'
|
# app = Rack::Builder.new do
|
||||||
# app = Rack::Builder.new do
|
# use Rack::CommonLogger
|
||||||
# use Rack::CommonLogger
|
# map "/ok" do
|
||||||
# use Rack::ShowExceptions
|
# run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] }
|
||||||
# map "/lobster" do
|
# end
|
||||||
# use Rack::Lint
|
# end
|
||||||
# run Rack::Lobster.new
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
#
|
#
|
||||||
# run app
|
# run app
|
||||||
#
|
#
|
||||||
# Or
|
# Or
|
||||||
#
|
#
|
||||||
# app = Rack::Builder.app do
|
# app = Rack::Builder.app do
|
||||||
# use Rack::CommonLogger
|
# use Rack::CommonLogger
|
||||||
# run lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['OK']] }
|
# run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] }
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# run app
|
# run app
|
||||||
#
|
#
|
||||||
# +use+ adds middleware to the stack, +run+ dispatches to an application.
|
# +use+ adds middleware to the stack, +run+ dispatches to an application.
|
||||||
# You can use +map+ to construct a Rack::URLMap in a convenient way.
|
# You can use +map+ to construct a Rack::URLMap in a convenient way.
|
||||||
@ -180,15 +177,6 @@ module Rack
|
|||||||
#
|
#
|
||||||
# run Heartbeat.new
|
# run Heartbeat.new
|
||||||
#
|
#
|
||||||
# It could also be a module:
|
|
||||||
#
|
|
||||||
# module HelloWorld
|
|
||||||
# def call(env)
|
|
||||||
# [200, { "content-type" => "text/plain" }, ["Hello World"]]
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
#
|
|
||||||
# run HelloWorld
|
|
||||||
def run(app = nil, &block)
|
def run(app = nil, &block)
|
||||||
raise ArgumentError, "Both app and block given!" if app && block_given?
|
raise ArgumentError, "Both app and block given!" if app && block_given?
|
||||||
|
|
||||||
@ -213,21 +201,35 @@ module Rack
|
|||||||
# the Rack application specified by run inside the block. Other requests will be sent to the
|
# the Rack application specified by run inside the block. Other requests will be sent to the
|
||||||
# default application specified by run outside the block.
|
# default application specified by run outside the block.
|
||||||
#
|
#
|
||||||
# Rack::Builder.app do
|
# class App
|
||||||
# map '/heartbeat' do
|
# def call(env)
|
||||||
# run Heartbeat
|
# [200, {'content-type' => 'text/plain'}, ["Hello World"]]
|
||||||
# end
|
# end
|
||||||
# run App
|
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
|
# class Heartbeat
|
||||||
|
# def call(env)
|
||||||
|
# [200, { "content-type" => "text/plain" }, ["OK"]]
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# app = Rack::Builder.app do
|
||||||
|
# map '/heartbeat' do
|
||||||
|
# run Heartbeat.new
|
||||||
|
# end
|
||||||
|
# run App.new
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# run app
|
||||||
|
#
|
||||||
# The +use+ method can also be used inside the block to specify middleware to run under a specific path:
|
# The +use+ method can also be used inside the block to specify middleware to run under a specific path:
|
||||||
#
|
#
|
||||||
# Rack::Builder.app do
|
# app = Rack::Builder.app do
|
||||||
# map '/heartbeat' do
|
# map '/heartbeat' do
|
||||||
# use Middleware
|
# use Middleware
|
||||||
# run Heartbeat
|
# run Heartbeat.new
|
||||||
# end
|
# end
|
||||||
# run App
|
# run App.new
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# This example includes a piece of middleware which will run before +/heartbeat+ requests hit +Heartbeat+.
|
# This example includes a piece of middleware which will run before +/heartbeat+ requests hit +Heartbeat+.
|
||||||
@ -102,11 +102,16 @@ module Rack
|
|||||||
CHUNKED == get_header(TRANSFER_ENCODING)
|
CHUNKED == get_header(TRANSFER_ENCODING)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def no_entity_body?
|
||||||
|
# The response body is an enumerable body and it is not allowed to have an entity body.
|
||||||
|
@body.respond_to?(:each) && STATUS_WITH_NO_ENTITY_BODY[@status]
|
||||||
|
end
|
||||||
|
|
||||||
# Generate a response array consistent with the requirements of the SPEC.
|
# Generate a response array consistent with the requirements of the SPEC.
|
||||||
# @return [Array] a 3-tuple suitable of `[status, headers, body]`
|
# @return [Array] a 3-tuple suitable of `[status, headers, body]`
|
||||||
# which is suitable to be returned from the middleware `#call(env)` method.
|
# which is suitable to be returned from the middleware `#call(env)` method.
|
||||||
def finish(&block)
|
def finish(&block)
|
||||||
if STATUS_WITH_NO_ENTITY_BODY[@status]
|
if no_entity_body?
|
||||||
delete_header CONTENT_TYPE
|
delete_header CONTENT_TYPE
|
||||||
delete_header CONTENT_LENGTH
|
delete_header CONTENT_LENGTH
|
||||||
close
|
close
|
||||||
@ -121,13 +121,13 @@ module Rack
|
|||||||
}.join("&")
|
}.join("&")
|
||||||
when Hash
|
when Hash
|
||||||
value.map { |k, v|
|
value.map { |k, v|
|
||||||
build_nested_query(v, prefix ? "#{prefix}[#{escape(k)}]" : escape(k))
|
build_nested_query(v, prefix ? "#{prefix}[#{k}]" : k)
|
||||||
}.delete_if(&:empty?).join('&')
|
}.delete_if(&:empty?).join('&')
|
||||||
when nil
|
when nil
|
||||||
prefix
|
escape(prefix)
|
||||||
else
|
else
|
||||||
raise ArgumentError, "value must be a Hash" if prefix.nil?
|
raise ArgumentError, "value must be a Hash" if prefix.nil?
|
||||||
"#{prefix}=#{escape(value)}"
|
"#{escape(prefix)}=#{escape(value)}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ module Rack
|
|||||||
VERSION
|
VERSION
|
||||||
end
|
end
|
||||||
|
|
||||||
RELEASE = "3.0.1"
|
RELEASE = "3.0.2"
|
||||||
|
|
||||||
# Return the Rack release as a dotted string.
|
# Return the Rack release as a dotted string.
|
||||||
def self.release
|
def self.release
|
||||||
Loading…
x
Reference in New Issue
Block a user