massimo 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ module Massimo
11
11
  protected
12
12
 
13
13
  def compile
14
- case source_path.extname.to_s
14
+ case source_path.extname
15
15
  when '.coffee'
16
16
  require 'coffee-script' unless defined?(CoffeeScript)
17
17
  CoffeeScript.compile(content, Massimo.config.options_for(:coffee_script))
data/lib/massimo/page.rb CHANGED
@@ -51,27 +51,33 @@ module Massimo
51
51
  protected
52
52
 
53
53
  def read_source
54
- @line = nil
55
- @content = ''
56
- front_matter = false
57
- meta_data = ''
58
-
59
- source_path.open do |file|
60
- file.each do |line|
61
- if line =~ /\A---\s*\Z/
62
- front_matter = !front_matter
63
- else
64
- if front_matter
65
- meta_data << line
54
+ case source_path.extname
55
+ when '.yml', '.yaml'
56
+ @meta_data = (YAML.load(source_path.read) || {}).symbolize_keys
57
+ @content = @meta_data[:content] || ''
58
+ else
59
+ @line = nil
60
+ @content = ''
61
+ front_matter = false
62
+ meta_data = ''
63
+
64
+ source_path.open do |file|
65
+ file.each do |line|
66
+ if line =~ /\A---\s*\Z/
67
+ front_matter = !front_matter
66
68
  else
67
- @line ||= file.lineno
68
- @content << line
69
+ if front_matter
70
+ meta_data << line
71
+ else
72
+ @line ||= file.lineno
73
+ @content << line
74
+ end
69
75
  end
70
76
  end
71
77
  end
78
+
79
+ @meta_data = (YAML.load(meta_data) || {}).symbolize_keys
72
80
  end
73
-
74
- @meta_data = (YAML.load(meta_data) || {}).symbolize_keys
75
81
  end
76
82
 
77
83
  def method_missing(method, *args, &block)
@@ -1,7 +1,7 @@
1
1
  module Massimo
2
2
  class Stylesheet < Massimo::Resource
3
3
  def render
4
- case source_path.extname.to_s
4
+ case source_path.extname
5
5
  when '.sass', '.scss'
6
6
  require 'sass' unless defined?(Sass)
7
7
  options = Massimo.config.options_for(:sass).merge(:css_filename => output_path)
data/lib/massimo.rb CHANGED
@@ -12,7 +12,7 @@ module Massimo
12
12
  autoload :View, 'massimo/view'
13
13
  autoload :Watcher, 'massimo/watcher'
14
14
 
15
- VERSION = '0.6.4'
15
+ VERSION = '0.6.5'
16
16
 
17
17
  class << self
18
18
  def site
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 4
9
- version: 0.6.4
8
+ - 5
9
+ version: 0.6.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Pete Browne