rack-app-front_end 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rack/app/front_end/instance_methods.rb +1 -2
- data/lib/rack/app/front_end/singleton_methods.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcf5a9dd6e5307c8eb8fc926f8aeddd9f1b49535
|
4
|
+
data.tar.gz: bcc3dbffa8b7e148e8c2025ed6519111681b65c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8245eb48ef9ac27281d5de3711396cc5406500d2387f51b31519025691b2052652f32da0e6a9b30d274f21735022fd1c58b621d6dc122116b903d9ded4893d47
|
7
|
+
data.tar.gz: 156849ec6e4458f39acdae7b9b32e4c2cf1f960a9480e3b8347219b06080214f0eae0a411c1e7b03733e7eea3ef7f9ba0c9784c30776aaa70cd2dfee094b35ed
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.10.0
|
@@ -4,8 +4,7 @@ module Rack::App::FrontEnd::InstanceMethods
|
|
4
4
|
|
5
5
|
options = {}
|
6
6
|
options[:layout]= self.class.layout if self.class.respond_to?(:layout)
|
7
|
-
|
8
|
-
full_path = File.exist?(extended_template_path) ? extended_template_path : template_path
|
7
|
+
full_path = Rack::App::Utils.expand_path(template_path)
|
9
8
|
template = Rack::App::FrontEnd::Template.new(full_path, options)
|
10
9
|
|
11
10
|
return template.render(self)
|
@@ -11,4 +11,12 @@ module Rack::App::FrontEnd::SingletonMethods
|
|
11
11
|
@layout
|
12
12
|
end
|
13
13
|
|
14
|
+
def precache_templates(*template_paths)
|
15
|
+
full_paths = template_paths.map { |path| Rack::App::Utils.expand_path(path) }
|
16
|
+
full_paths.each do |full_path|
|
17
|
+
Rack::App::FrontEnd::Template.cache.fetch(full_path) { Tilt.new(full_path) }
|
18
|
+
end
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
|
14
22
|
end
|