Skip to content
Browse files

Merge pull request #16 from maccman/master

This fixes support for Rails 3.2.1
  • Loading branch information...
2 parents 8495125 + 82838e2 commit 4b92a41c23f2b2e2167610f17e388db606b5046a @wycats committed Feb 7, 2012
Showing with 8 additions and 11 deletions.
  1. +6 −8 lib/rack-offline.rb
  2. +2 −3 lib/rack/offline.rb
View
14 lib/rack-offline.rb
@@ -9,17 +9,16 @@ def self.call(env)
def initialize(options = {}, app = Rails.application, &block)
config = app.config
- root = config.paths.public.to_a.first
-
- block = cache_block(Pathname.new(root)) unless block_given?
+ root = config.paths['public'].first
+ block = cache_block(Pathname.new(root)) unless block_given?
opts = {
- :cache => config.cache_classes,
- :root => root,
+ :cache => config.cache_classes,
+ :root => root,
:logger => Rails.logger
}.merge(options)
- super opts, &block
+ super(opts, &block)
end
private
@@ -42,9 +41,8 @@ def cache_block(root)
cache Pathname.new(file).relative_path_from(root)
end
- network "/"
+ network "*"
end
end
-
end
end
View
5 lib/rack/offline.rb
@@ -83,7 +83,6 @@ def precache_key!
def uncached_key
now = Time.now.to_i - Time.now.to_i % @cache_interval
Digest::SHA2.hexdigest(now.to_s)
- end
-
+ end
end
-end
+end

0 comments on commit 4b92a41

Please sign in to comment.
Something went wrong with that request. Please try again.