rails-cached-routes 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ce322076dded160513fbd3ad08bf642d0fdbf0b
4
- data.tar.gz: a6d95f51b4f2a747f7ac6b19bd57355443d5a0ad
3
+ metadata.gz: b9361f0ec7022201495a7d55ebebb7f5140f9728
4
+ data.tar.gz: 9165140dcdb5e5600f5c1a7953ca60ebf609d930
5
5
  SHA512:
6
- metadata.gz: 449a2c21e367ee27a8b2b34e86dc9282c3a3cd0f324c0c5205666e9383dbdf7fa279283ead4cd458026a8e682901a15d43af507f35750fc2d653837be354ad9e
7
- data.tar.gz: 7e5e729f756cb5d01c407707fbbcc6a175b867ed1c9ad9f251c786de14daad981bed98aaf21e729267846ea293b105f33294b525c4121a33d01414360dec9403
6
+ metadata.gz: e3545c462e7ac64f1aad597a34651e04b380c476f492bed198c7ebb1eeaf86a2c8e483565fefd07249e379fcbd8dbc87cab76476c82c9d86e492f7407494bc66
7
+ data.tar.gz: ff191c5e3f6fdf9bc2d52d0e4ffcbc5900ca5205e284644f7113d393351f41aad00d992a3b20c22895f767e2ff93581459ec5501e9bd0d93bc4377082e73f91b
@@ -34,13 +34,14 @@ module CachedRoutes
34
34
  nil
35
35
  end
36
36
 
37
- def unmarshal_routes(routes)
37
+ def unmarshal_routes(routes, named_routes)
38
38
  File.open(cached_file, 'rb') do |io|
39
39
  Marshal.load(io).each do |route|
40
40
  if CachedRedirect === route.app
41
41
  route.instance_variable_set :@app, route.app.to_action_dispatch_redirect
42
42
  end
43
43
  routes << route
44
+ named_routes[route.name] = route if route.name
44
45
  end
45
46
  end
46
47
  end
@@ -8,7 +8,7 @@ module CachedRoutes
8
8
  def draw_with_caching(*args, &block)
9
9
  marshaller = Marshaller.new
10
10
  if marshaller.can_unmarshal_routes?
11
- marshaller.unmarshal_routes(self.set.routes)
11
+ marshaller.unmarshal_routes(self.set.routes, self.named_routes)
12
12
  else
13
13
  routes_before = self.set.routes.clone
14
14
  draw_without_caching(*args, &block)
@@ -1,3 +1,3 @@
1
1
  module CachedRoutes
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-cached-routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David McCullars
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-09 00:00:00.000000000 Z
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails