Class: Adva::Static::Import::Format::Jekyll

Inherits:
Base
  • Object
show all
Defined in:
lib/adva/static/import/format.rb

Instance Attribute Summary

Attributes inherited from Base

#path

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Adva::Static::Import::Format::Base

Instance Method Details

#readObject



44
45
46
47
48
49
# File 'lib/adva/static/import/format.rb', line 44

def read
  File.read(path) =~ /^(---\s*\n.*?\n?)^---\s*$\n?(.*)/m
  data = YAML.load($1) rescue {}
  data.merge!(:body => $2) if $2
  data
end