Skip to content

Commit

Permalink
Merge pull request #171 from bmizerany/master
Browse files Browse the repository at this point in the history
Whitespace errors
  • Loading branch information
josh committed May 24, 2011
2 parents ecaec50 + 49b241e commit 5851aac
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion contrib/rack_logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/rack/auth/digest/md5.rb
Expand Up @@ -24,7 +24,7 @@ class MD5 < AbstractHandler
def initialize(app, realm=nil, opaque=nil, &authenticator)
@passwords_hashed = nil
if opaque.nil? and realm.respond_to? :values_at
realm, opaque, @passwords_hashed = realm.values_at :realm, :opaque, :passwords_hashed
realm, opaque, @passwords_hashed = realm.values_at :realm, :opaque, :passwords_hashed
end
super(app, realm, &authenticator)
@opaque = opaque
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/builder.rb
Expand Up @@ -113,7 +113,7 @@ def run(app)
# end
# end
#
# This example includes a piece of middleware which will run before requests hit +Heartbeat+.
# This example includes a piece of middleware which will run before requests hit +Heartbeat+.
#
def map(path, &block)
if @ins.last.kind_of? Hash
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/handler/fastcgi.rb
Expand Up @@ -28,7 +28,7 @@ def self.run(app, options={})
serve request, app
}
end

def self.valid_options
{
"Host=HOST" => "Hostname to listen on (default: localhost)",
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/handler/scgi.rb
Expand Up @@ -15,7 +15,7 @@ def self.run(app, options=nil)
:port=>options[:Port],
:socket=>options[:Socket])).listen
end

def self.valid_options
{
"Host=HOST" => "Hostname to listen on (default: localhost)",
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/handler/webrick.rb
Expand Up @@ -12,7 +12,7 @@ def self.run(app, options={})
yield @server if block_given?
@server.start
end

def self.valid_options
{
"Host=HOST" => "Hostname to listen on (default: localhost)",
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/multipart/generator.rb
Expand Up @@ -68,7 +68,7 @@ def flattened_params
h
end
end

def content_for_tempfile(io, file, name)
<<-EOF
--#{MULTIPART_BOUNDARY}\r
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/multipart/parser.rb
Expand Up @@ -15,7 +15,7 @@ def parse
fast_forward_to_first_boundary

loop do
head, filename, content_type, name, body =
head, filename, content_type, name, body =
get_current_head_and_filename_and_content_type_and_name_and_body

# Save the rest.
Expand Down
10 changes: 5 additions & 5 deletions lib/rack/server.rb
Expand Up @@ -47,11 +47,11 @@ def parse!(args)
opts.on("-p", "--port PORT", "use PORT (default: 9292)") { |port|
options[:Port] = port
}

opts.on("-O", "--option NAME[=VALUE]", "pass VALUE to the server as option NAME. If no VALUE, sets it to true. Run '#{$0} -s SERVER -h' to get a list of options for SERVER") { |name|
name, value = name.split('=', 2)
value = true if value.nil?
options[name.to_sym] = value
options[name.to_sym] = value
}

opts.on("-E", "--env ENVIRONMENT", "use ENVIRONMENT for defaults (default: development)") { |e|
Expand All @@ -72,7 +72,7 @@ def parse!(args)
opts.on_tail("-h", "-?", "--help", "Show this message") do
puts opts
puts handler_opts(options)

exit
end

Expand All @@ -92,15 +92,15 @@ def parse!(args)
options[:config] = args.last if args.last
options
end

def handler_opts(options)
begin
info = []
server = Rack::Handler.get(options[:server]) || Rack::Handler.default(options)
if server && server.respond_to?(:valid_options)
info << ""
info << "Server-specific options for #{server.name}:"

has_options = false
server.valid_options.each do |name, description|
next if name.to_s.match(/^(Host|Port)[^a-zA-Z]/) # ignore handler's host and port options, we do our own.
Expand Down
2 changes: 1 addition & 1 deletion test/spec_utils.rb
Expand Up @@ -76,7 +76,7 @@
should.equal "foo" => "bar", "baz" => ""
Rack::Utils.parse_nested_query("my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F").
should.equal "my weird field" => "q1!2\"'w$5&7/z8)?"

Rack::Utils.parse_nested_query("a=b&pid%3D1234=1023").
should.equal "pid=1234" => "1023", "a" => "b"

Expand Down

0 comments on commit 5851aac

Please sign in to comment.