Method: Stic::Metadata::Yaml#parse

Defined in:
lib/stic/metadata/yaml.rb

#parse(blob, str) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/stic/metadata/yaml.rb', line 37

def parse(blob, str)
  if (match = match(blob, str))
    begin
      [
        ::YAML.load(preprocess_data(blob, match[:data])),
        preprocess_content(blob, match[:content])
      ]
    rescue Psych::SyntaxError => err
      raise Stic::.new blob: blob
    end
  end
end