Sha256: 4d92154a9c66901e471b04f5ef79718c2c8f6f8148293efa7facb31193cbc1ff

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

#!/usr/bin/env ruby

require "pathname"
require "fileutils"


ARGV.each do |filename|
  filename = Pathname(filename)

  contents = File.read(filename).split(/\n/)
  File.open(filename,"w") do |file|
    contents.each do |line|
      file.puts line.gsub(/methadone/,"optparse_plus").gsub(/Methadone/,"OptparsePlus")
    end
  end

  if filename.split.any? { |_| _ == "methadone" }
    new_filename = filename.split.map { |_|
      if _ == "methadone"
        "optparse_plus"
      else
        _
      end
    }.join
    FileUtils.mkdir_p new_filename.dirname
    FileUtils.mv filename new_filename
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
optparse-plus-3.0.0 fix.rb