Skip to content

Commit

Permalink
deflater.rb - Removed unnecessary require "time" and whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
qerub authored and leahneukirchen committed Jul 6, 2008
1 parent d2d51ff commit a2157d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions lib/rack/deflater.rb
@@ -1,6 +1,5 @@
require "zlib"
require "stringio"
require "time"

module Rack

Expand All @@ -12,7 +11,7 @@ def initialize(app)
def call(env)
status, headers, body = @app.call(env)

request = Request.new(env)
request = Request.new(env)

encoding = Utils.select_best_encoding(%w(gzip deflate identity), request.accept_encoding)

Expand All @@ -30,7 +29,7 @@ def call(env)
end
end

def self.gzip(body, mtime=Time.now)
def self.gzip(body, mtime = Time.now)
io = StringIO.new
gzip = Zlib::GzipWriter.new(io)
gzip.mtime = mtime
Expand Down
4 changes: 2 additions & 2 deletions test/spec_rack_deflater.rb
Expand Up @@ -12,7 +12,7 @@ def build_response(body, accept_encoding, headers = {})

return response
end

specify "should be able to deflate bodies that respond to each" do
body = Object.new
class << body; def each; yield("foo"); yield("bar"); end; end
Expand All @@ -32,7 +32,7 @@ class << body; def each; yield("foo"); yield("bar"); end; end
response[1].should.equal({ "Content-Encoding" => "deflate" })
response[2].to_s.should.equal("\363H\315\311\311W(\317/\312IQ\004\000")
end

specify "should be able to gzip bodies that respond to each" do
body = Object.new
class << body; def each; yield("foo"); yield("bar"); end; end
Expand Down

0 comments on commit a2157d0

Please sign in to comment.