Skip to content

Commit

Permalink
fix whitespace errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bmizerany authored and rkh committed Jun 16, 2011
1 parent d000e39 commit 6c75c0c
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) def initialize(app, realm=nil, opaque=nil, &authenticator)
@passwords_hashed = nil @passwords_hashed = nil
if opaque.nil? and realm.respond_to? :values_at 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 end
super(app, realm, &authenticator) super(app, realm, &authenticator)
@opaque = opaque @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
# 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) def map(path, &block)
if @ins.last.kind_of? Hash 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 serve request, app
} }
end end

def self.valid_options def self.valid_options
{ {
"Host=HOST" => "Hostname to listen on (default: localhost)", "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], :port=>options[:Port],
:socket=>options[:Socket])).listen :socket=>options[:Socket])).listen
end end

def self.valid_options def self.valid_options
{ {
"Host=HOST" => "Hostname to listen on (default: localhost)", "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? yield @server if block_given?
@server.start @server.start
end end

def self.valid_options def self.valid_options
{ {
"Host=HOST" => "Hostname to listen on (default: localhost)", "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 h
end end
end end

def content_for_tempfile(io, file, name) def content_for_tempfile(io, file, name)
<<-EOF <<-EOF
--#{MULTIPART_BOUNDARY}\r --#{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 fast_forward_to_first_boundary


loop do 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 get_current_head_and_filename_and_content_type_and_name_and_body


# Save the rest. # 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| opts.on("-p", "--port PORT", "use PORT (default: 9292)") { |port|
options[:Port] = 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| 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) name, value = name.split('=', 2)
value = true if value.nil? 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| 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 opts.on_tail("-h", "-?", "--help", "Show this message") do
puts opts puts opts
puts handler_opts(options) puts handler_opts(options)

exit exit
end end


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

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

has_options = false has_options = false
server.valid_options.each do |name, description| 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. 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" => "" should.equal "foo" => "bar", "baz" => ""
Rack::Utils.parse_nested_query("my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F"). 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)?" should.equal "my weird field" => "q1!2\"'w$5&7/z8)?"

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


Expand Down

0 comments on commit 6c75c0c

Please sign in to comment.