dimples 1.1.3 → 1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dimples/page.rb +0 -4
- data/lib/dimples/post.rb +0 -4
- data/lib/dimples/publishable.rb +12 -4
- data/lib/dimples/template.rb +0 -4
- data/lib/dimples/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: d4908e2152e8b62a29f3fdc22f75a3e5d6bc5f19
|
4
|
+
data.tar.gz: 0561a17cd5b12638bd61ae94af722cbc2b198706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb93e7a063f1ece6224877251b9b132e5ef349221b81a42bceae3642b2c9ac612301976979aa88ebeb00416d54d80191fada37df313cf70b4dfa383ceb08adec
|
7
|
+
data.tar.gz: f385a6d339a48e1ef2d63598111d39ce3ae737a7bbd87f5a00c371422326ccc60775cb89ec7f60d372cc986eafcca1e0a089598b922ebeee6840c035dfdfc692
|
data/lib/dimples/page.rb
CHANGED
data/lib/dimples/post.rb
CHANGED
data/lib/dimples/publishable.rb
CHANGED
@@ -14,8 +14,16 @@ module Dimples
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def render(context = {}, body = nil, use_layout = true)
|
17
|
+
class_name = self.class.name.split('::').last.downcase.to_sym
|
18
|
+
|
17
19
|
context[:site] = @site unless context[:site]
|
18
|
-
context[
|
20
|
+
context[class_name] = self unless context[class_name]
|
21
|
+
|
22
|
+
scope = Object.new
|
23
|
+
|
24
|
+
context.each_pair do |key, value|
|
25
|
+
scope.instance_variable_set("@#{key}".to_sym, value)
|
26
|
+
end
|
19
27
|
|
20
28
|
proc = Proc.new { |template| contents() }
|
21
29
|
|
@@ -27,15 +35,15 @@ module Dimples
|
|
27
35
|
else
|
28
36
|
Tilt::StringTemplate.new(&proc)
|
29
37
|
end
|
30
|
-
|
38
|
+
|
31
39
|
begin
|
32
|
-
output = renderer.render(
|
40
|
+
output = renderer.render(scope) { body }.strip
|
33
41
|
@rendered_contents = output
|
34
42
|
rescue RuntimeError, TypeError, NoMethodError, SyntaxError => e
|
35
43
|
problem_file = if @path
|
36
44
|
@path.gsub(@site.source_paths[:root], '')
|
37
45
|
else
|
38
|
-
"dynamic #{
|
46
|
+
"dynamic #{self.class}"
|
39
47
|
end
|
40
48
|
|
41
49
|
raise "Failed to render #{problem_file} - #{e}"
|
data/lib/dimples/template.rb
CHANGED
data/lib/dimples/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dimples
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Bogan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|