Sha256: ebfd629cc4f2ad46db46bcd613cb1e4752bc0658a11e3c766b8b9d1aa43b645f

Contents?: true

Size: 476 Bytes

Versions: 16

Compression:

Stored size: 476 Bytes

Contents

#!/usr/bin/env ruby -i
# encoding: utf-8

# helpers
def pass; end

# main
buffer = ARGF.inject(String.new) do |buffer, line|
  # line filters
  line.gsub!(/\s*\n$/, "\n")
  line.gsub!("'", '"')
  line.gsub!('u"', '"') if line =~ /^\s*# \[/

  buffer += line
end

# buffer filters
buffer.gsub!(/\n{2,}/m, "\n\n")
pass while buffer.gsub!(/(\n( *)  end)\n{2,}(\2end)/m, "\\1\n\\3")

# Make sure there's only one \n at the end
pass while buffer.chomp!
buffer += "\n"

puts buffer

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
amq-protocol-0.9.0 post-processing.rb
amq-protocol-0.8.4 post-processing.rb
amq-protocol-0.8.3 post-processing.rb
amq-protocol-0.8.1 post-processing.rb
amq-protocol-0.8.0 post-processing.rb
amq-protocol-0.7.0 post-processing.rb
amq-protocol-0.7.0.beta2 post-processing.rb
amq-protocol-0.7.0.beta1 post-processing.rb
amq-protocol-0.7.0.alpha7 post-processing.rb
amq-protocol-0.7.0.alpha6 post-processing.rb
amq-protocol-0.7.0.alpha5 post-processing.rb
amq-protocol-0.7.0.alpha4 post-processing.rb
amq-protocol-0.7.0.alpha2 post-processing.rb
amq-protocol-0.7.0.alpha1 post-processing.rb
amq-protocol-0.6.0.pre post-processing.rb
amq-protocol-0.5.0 post-processing.rb