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 +4 -4
- data/lib/cached_routes/marshaller.rb +2 -1
- data/lib/cached_routes/route_set.rb +1 -1
- data/lib/cached_routes/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9361f0ec7022201495a7d55ebebb7f5140f9728
|
4
|
+
data.tar.gz: 9165140dcdb5e5600f5c1a7953ca60ebf609d930
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
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.
|
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-
|
11
|
+
date: 2014-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|