Skip to content

Instantly share code, notes, and snippets.

@elorest
Created May 21, 2021 06:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elorest/ac94401211a68ccc52674ce90334d503 to your computer and use it in GitHub Desktop.
Save elorest/ac94401211a68ccc52674ce90334d503 to your computer and use it in GitHub Desktop.
File.open("tmp/catalog.yml", "w") do |f|
f.puts "---"
CanComm::NBuffers.instance.to_hash.each do |k, v|
f.puts "#{k.to_s}:"
v.frame_fields.each do |fk, fv|
f.puts " #{fk}:"
fv.to_yaml.gsub("---\n", "").split("\n").each_with_index do |line, i|
next if i < 7
f.puts " #{line}"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment