howl 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/howl.gemspec +1 -1
- data/lib/howl/template.rb +7 -3
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.3
|
data/howl.gemspec
CHANGED
data/lib/howl/template.rb
CHANGED
@@ -8,7 +8,7 @@ module Howl
|
|
8
8
|
viewables.push(*viewables)
|
9
9
|
end
|
10
10
|
|
11
|
-
attr_accessor :view, :content, :site, :path, :relative_path, :extension
|
11
|
+
attr_accessor :view, :view_data, :content, :site, :path, :relative_path, :extension
|
12
12
|
|
13
13
|
def initialize(path, site)
|
14
14
|
@site = site
|
@@ -63,7 +63,7 @@ module Howl
|
|
63
63
|
private
|
64
64
|
|
65
65
|
def find_template(template_name)
|
66
|
-
@site.templates[template_name] ||
|
66
|
+
@site.templates[template_name] ||
|
67
67
|
@site.templates[template_name + extension] ||
|
68
68
|
@site.templates[template_name + converter.extension]
|
69
69
|
end
|
@@ -74,10 +74,14 @@ module Howl
|
|
74
74
|
|
75
75
|
def load_file
|
76
76
|
content = @path.read
|
77
|
-
view,
|
77
|
+
view, content = content.split("\n\n", 2)
|
78
|
+
|
79
|
+
view ||= ""
|
80
|
+
content ||= ""
|
78
81
|
|
79
82
|
if test_for_yaml(view)
|
80
83
|
@content = content
|
84
|
+
@view_data = view
|
81
85
|
view = YAML.load(view)
|
82
86
|
else
|
83
87
|
@content = "#{view}\n\n#{content}".strip
|