diff options
author | 2015-03-15 11:56:57 +0100 | |
---|---|---|
committer | 2015-03-15 11:56:57 +0100 | |
commit | fc1303c200ba3621c6063fe3f9aa91d89c06b21a (patch) | |
tree | 72388f5151e2b6b802b36545d34e5b7c649d9312 /lib | |
parent | Add notice on RSS updates (diff) | |
download | security-fc1303c200ba3621c6063fe3f9aa91d89c06b21a.tar.gz security-fc1303c200ba3621c6063fe3f9aa91d89c06b21a.tar.bz2 security-fc1303c200ba3621c6063fe3f9aa91d89c06b21a.zip |
Implement yaml dump
Diffstat (limited to 'lib')
-rw-r--r-- | lib/helpers.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/helpers.rb b/lib/helpers.rb index 9a2f0f1..ab90435 100644 --- a/lib/helpers.rb +++ b/lib/helpers.rb @@ -44,6 +44,16 @@ helpers do COMP_MAP.invert[val] end + def yaml_dump(items) + items.map do |item| + { + 'id' => item.id, + 'title' => item.title, + 'severity' => item.severity + } + end.to_yaml + end + def feed(type, items) RSS::Maker.make(type) do |maker| maker.channel.author = "Gentoo Security Team" |