Sha256: 5f264e4de5778511587754413446bffbb34709bd0faa0bb40caf1852c8d29ec1
Contents?: true
Size: 355 Bytes
Versions: 62
Compression:
Stored size: 355 Bytes
Contents
#!/usr/bin/ruby # frozen_string_literal: true arg = ARGV[0] val = if arg.nil? $stdin.read else File.read(arg) end d = (val.gsub(/(?<=\s)".*?"/) do |i| "“#{i[1..-2]}”" end).gsub(/\s*”\s*([,.?!])/, '\\1”').gsub(/([ \t])[ \t]+/, '\\1').gsub(/\n\n\n*/, "\n\n").strip if arg.nil? print d else File.write arg, d end
Version data entries
62 entries across 31 versions & 6 rubygems