如何在Ruby中从文本文件中移除像这样的YAML头部:
(YAML的开始和结束都用三条破折号(-)括起来)
---
date: 2013-02-02 11:22:33
title: "Some Title"
Foo: Bar
...
---
(YAML的开始和结束都用三条破折号(-)括起来)
我尝试过
text.gsub(/---(.*)---/, '') # text is the variable which contains the full text of the file
但它没有起作用。