Gtk4-tutorial/mktbl.rb

8 lines
245 B
Ruby
Raw Normal View History

require_relative 'lib/lib_src2md.rb'
2022-04-16 08:46:29 +02:00
src = File.read ARGV[0]
buf = src.partitions(/^@@@table\n.*?@@@\n/m)
dst = buf.map{|chunk| chunk=~/\A@@@table/ ? at_table(chunk) : chunk}.join
File.write ARGV[0]+".bak", src # backup
File.write ARGV[0], dst