Method: Devcenter::ArticleFile.read

Defined in:
lib/devcenter/article_file.rb

.read(src_path) ⇒ Object



22
23
24
25
26
27
# File 'lib/devcenter/article_file.rb', line 22

def self.read(src_path)
  src = IO.read(src_path)
  , content = src.split(/\r*\n\r*\n/, 2)
   = OpenStruct.new YAML.load()
  new(metadata: , content: content)
end