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

Version Path
ufos-1.0.94 ./bin/quot
ufos-1.0.94 ./non_compiled_programs/quot
aliens-1.0.94 ./non_compiled_programs/quot
aliens-1.0.94 ./bin/quot
freespeech-1.0.94 ./bin/quot
freespeech-1.0.94 ./non_compiled_programs/quot
elonmusk-1.0.94 ./bin/quot
elonmusk-1.0.94 ./non_compiled_programs/quot
politics-1.0.94 ./non_compiled_programs/quot
politics-1.0.94 ./bin/quot
democracy-1.0.94 ./non_compiled_programs/quot
democracy-1.0.94 ./bin/quot
democracy-1.0.93 ./bin/quot
democracy-1.0.93 ./non_compiled_programs/quot
ufos-1.0.91 ./non_compiled_programs/quot
ufos-1.0.91 ./bin/quot
aliens-1.0.91 ./bin/quot
aliens-1.0.91 ./non_compiled_programs/quot
freespeech-1.0.91 ./non_compiled_programs/quot
freespeech-1.0.91 ./bin/quot