Permalink
Browse files

Revert "Only static asset should read length from disk"

This reverts commit 921f81c.
  • Loading branch information...
1 parent 921f81c commit 2209ed249b1a913ef4c5cba16ed4436fcae7f296 @josh josh committed Nov 3, 2011
Showing with 1 addition and 6 deletions.
  1. +1 −0 lib/sprockets/asset.rb
  2. +0 −6 lib/sprockets/static_asset.rb
View
@@ -37,6 +37,7 @@ def initialize(environment, logical_path, pathname)
@pathname = Pathname.new(pathname)
@content_type = environment.content_type_of(pathname)
@mtime = environment.stat(pathname).mtime
+ @length = environment.stat(pathname).size
@digest = environment.file_digest(pathname).hexdigest
end
@@ -7,12 +7,6 @@ module Sprockets
# any processing or concatenation. These are typical images and
# other binary files.
class StaticAsset < Asset
- def initialize(environment, logical_path, pathname)
- super
-
- @length = environment.stat(pathname).size
- end
-
# Returns file contents as its `source`.
def source
# File is read everytime to avoid memory bloat of large binary files

0 comments on commit 2209ed2

Please sign in to comment.