dusty_rails_renderer 0.2.2 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 782587e596b7f92ae1e459a3725f0f910a3a2da2
4
- data.tar.gz: 3ea4e11d7088903c095fded48ec385359b31854d
3
+ metadata.gz: a5e52b87519c6a042b560e7dd0fb68d7b9f2a34b
4
+ data.tar.gz: fd730bd2f33c1dcc598824aeafbcc01fd0a473b3
5
5
  SHA512:
6
- metadata.gz: 0eba41b1a2b12e83bf621455cf7616f17232bbf91968c135fbcf3c34168443e6d957d12a172b5419a89a43af7fbdbc6dc1c83bc927a83bce2fb26bf82ffa4f75
7
- data.tar.gz: 47695f1b6325d86481aa6b72c62117d278680ae829f363b11b96d4d9bf195b87c4b1a6e65699ae416bcbccf474ab1eb859989a7c6b41590460c461a6d3deca5f
6
+ metadata.gz: b147a2101e86b9e2f34e159196dfb7619205db337289b049fcea4f7334a096eae23aae5d2ff3d015d554306a76e2db0d689d0248109555007294dd58b1443412
7
+ data.tar.gz: 8d562cd2e90ccd8c122ef51760445db462cdd8e82eac83a26440b0995d7189175944e54b6c8fdf63bcd1a71fc8a500838e44e2318f81859f02ed665902796cd0
@@ -1,3 +1,3 @@
1
1
  module DustyRailsRenderer
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -41,11 +41,23 @@ module DustyRailsRenderer
41
41
  command = "dustc --name=#{template_name} #{file_url}"
42
42
  template = Open3.capture3("bash","-l","-c",command)
43
43
  escaped_template = escape_javascript(template[0])
44
+
45
+ if self.configuration.logging
46
+ puts "template name = #{template_name}"
47
+ puts "compiled template = #{escaped_template}"
48
+ end
49
+
44
50
  @context.eval("dust.loadSource(\"#{escaped_template}\")")
45
51
  @precompiled_templates[template_name] = template[0]
46
52
  else
47
53
  contents = File.read(file_url).gsub("\n","").gsub("\"","'").gsub("\t","")
48
54
  template = @context.eval("(function() {var template = dust.compile(\"#{contents}\",'#{template_name}'); dust.loadSource(template); return template; })()")
55
+
56
+ if self.configuration.logging
57
+ puts "template name = #{template_name}"
58
+ puts "compiled template = #{escaped_template}"
59
+ end
60
+
49
61
  @precompiled_templates[template_name] = template
50
62
  end
51
63
  end
@@ -66,6 +78,7 @@ module DustyRailsRenderer
66
78
  attr_accessor :production
67
79
  attr_accessor :dust_template_base_path
68
80
  attr_accessor :node_dust_compiler
81
+ attr_accessor :logging
69
82
 
70
83
  def initialize
71
84
  @dust_config_path = "config/dust_initializer.yml"
@@ -73,6 +86,7 @@ module DustyRailsRenderer
73
86
  @dust_template_base_path = "app/assets/javascripts/dust/"
74
87
  @production = false
75
88
  @node_dust_compiler = false
89
+ @logging = true
76
90
  end
77
91
  end
78
92
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dusty_rails_renderer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis Ellis