# File lib/simp/cli/config/items/item.rb, line 97 def to_yaml_s raise InternalError.new( "@key is empty for #{self.class}" ) if "#{@key}".empty? x = "=== #{@key} ===\n" x += "#{(description || 'FIXME: NO DESCRIPTION GIVEN')}\n" # comment every line that describes the item: x = x.each_line.map{ |y| "# #{y}" }.join # add yaml (but stripped of frontmatter and first indent) # TODO: should we be using SafeYAML? http://danieltao.com/safe_yaml/ x += { @key => @value }.to_yaml.gsub(/^---\s*\n/m, '').gsub(/^ /, '' ) x += "\n" if @skip_yaml nil else x end end