dusty_rails_renderer 0.2.8 → 0.3.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/lib/dusty_rails_renderer/version.rb +1 -1
- data/lib/dusty_rails_renderer.rb +9 -2
- 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: 139fb7b50dad615102937ff4d3cc9b20900066a1
|
|
4
|
+
data.tar.gz: 055e5f73b577b7f3a80aa7b28e729cadc282cc3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 75fe700c3a7f8979f83464079427e4bac45aba15b37d5a9e086a6b4c9d4ddcf3ad2d7e2561b3bb5abd4614f6b5a9592ec74b597010076b6275e47bef58d62349
|
|
7
|
+
data.tar.gz: 6f04d42036c6ee16566456b8d19b20f8b2629e8903d1142d73c3f44840152b8ad259180631be9433abb5ac469818d663d2cd78880ff767159e9760ce25c979fb
|
data/lib/dusty_rails_renderer.rb
CHANGED
|
@@ -11,6 +11,7 @@ module DustyRailsRenderer
|
|
|
11
11
|
@dust_config = YAML.load_file(self.configuration.dust_config_path)
|
|
12
12
|
@dust_library = File.read(self.configuration.dust_js_library_path)
|
|
13
13
|
@precompiled_templates = Hash.new
|
|
14
|
+
@last_modification_hash = Hash.new
|
|
14
15
|
@context = V8::Context.new
|
|
15
16
|
@context.eval(@dust_library, 'dustjs')
|
|
16
17
|
|
|
@@ -35,8 +36,14 @@ module DustyRailsRenderer
|
|
|
35
36
|
#Read in and register Dust.js templates
|
|
36
37
|
def read_dust_files
|
|
37
38
|
@dust_config.each do |template, info|
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
file_url = self.configuration.dust_template_base_path + info["file_path"]
|
|
40
|
+
template_name = info["name"]
|
|
41
|
+
|
|
42
|
+
if @last_modification_hash[template_name] == File.mtime(file_url)
|
|
43
|
+
next
|
|
44
|
+
else
|
|
45
|
+
@last_modification_hash[template_name] = File.mtime(file_url)
|
|
46
|
+
end
|
|
40
47
|
|
|
41
48
|
if self.configuration.logging
|
|
42
49
|
puts "file url = #{file_url}"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dusty_rails_renderer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Louis Ellis
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|