jekyll-rendering 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -0
- data/README +1 -1
- data/lib/jekyll/rendering.rb +24 -5
- data/lib/jekyll/rendering/version.rb +1 -1
- metadata +3 -3
data/ChangeLog
CHANGED
data/README
CHANGED
data/lib/jekyll/rendering.rb
CHANGED
@@ -41,6 +41,8 @@ module Jekyll
|
|
41
41
|
# Options passed to ERB.new: +safe_level+, +trim_mode+, +eoutvar+.
|
42
42
|
ERB_OPTIONS = [nil, nil, '_erbout' ]
|
43
43
|
|
44
|
+
ERROR_TRACE = 3
|
45
|
+
|
44
46
|
end
|
45
47
|
|
46
48
|
module Convertible
|
@@ -116,10 +118,16 @@ module Jekyll
|
|
116
118
|
raise NotImplementedError
|
117
119
|
end
|
118
120
|
|
119
|
-
def render_error(err, renderer = nil)
|
120
|
-
|
121
|
-
|
122
|
-
|
121
|
+
def render_error(err, renderer = nil, trace = Rendering::ERROR_TRACE)
|
122
|
+
msg = [self.class.name.split('::').last]
|
123
|
+
msg << "[#{renderer}]" if renderer
|
124
|
+
|
125
|
+
msg << 'Exception:' << err
|
126
|
+
msg << "(in #{data['layout'] || '(top)'})"
|
127
|
+
|
128
|
+
msg << "(from #{err.backtrace[0, trace].join(', ')})" if trace > 0
|
129
|
+
|
130
|
+
msg.join(' ')
|
123
131
|
end
|
124
132
|
|
125
133
|
end
|
@@ -142,6 +150,17 @@ module Jekyll
|
|
142
150
|
|
143
151
|
class Erb < Base
|
144
152
|
|
153
|
+
class LazyStruct < OpenStruct
|
154
|
+
|
155
|
+
def initialize(hash)
|
156
|
+
@table = Hash.new { |h, k|
|
157
|
+
new_ostruct_member(k)
|
158
|
+
h[k] = h.has_key?(s = k.to_s) ? h[s] : nil
|
159
|
+
}.update(hash)
|
160
|
+
end
|
161
|
+
|
162
|
+
end
|
163
|
+
|
145
164
|
class << self; attr_accessor :renderer; end
|
146
165
|
|
147
166
|
attr_reader :site, :page, :renderer, :encoding
|
@@ -164,7 +183,7 @@ module Jekyll
|
|
164
183
|
|
165
184
|
%w[site page paginator].each { |key|
|
166
185
|
value = payload[key] or next
|
167
|
-
instance_variable_set("@#{key}",
|
186
|
+
instance_variable_set("@#{key}", LazyStruct.new(value))
|
168
187
|
}
|
169
188
|
|
170
189
|
@renderer = self.class.renderer ||
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-rendering
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-24 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Jekyll plugin to provide alternative rendering engines.
|
15
15
|
email: jens.wille@uni-koeln.de
|
@@ -35,7 +35,7 @@ rdoc_options:
|
|
35
35
|
- --line-numbers
|
36
36
|
- --all
|
37
37
|
- --title
|
38
|
-
- jekyll-rendering Application documentation (v0.0.
|
38
|
+
- jekyll-rendering Application documentation (v0.0.9)
|
39
39
|
- --main
|
40
40
|
- README
|
41
41
|
require_paths:
|