mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Much simpler way to build todo yaml
https://stackoverflow.com/a/39906916/1586762 thx @asterite 🎉
This commit is contained in:
parent
b27d9ca740
commit
51fa9f024b
1 changed files with 1 additions and 9 deletions
|
@ -53,15 +53,7 @@ module Ameba::Formatter
|
|||
.compact
|
||||
.uniq!
|
||||
|
||||
nodes_builder = YAML::Nodes::Builder.new
|
||||
nodes_builder.mapping do
|
||||
rule.name.to_yaml nodes_builder
|
||||
rule.to_yaml nodes_builder
|
||||
end
|
||||
|
||||
YAML.build do |builder|
|
||||
nodes_builder.document.to_yaml(builder)
|
||||
end
|
||||
{rule.name => rule}.to_yaml
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue