Sha256: 53284daba710cd375b8020bc14020ea828712d3075bf13981e914eca56b29e1b

Contents?: true

Size: 358 Bytes

Versions: 1

Compression:

Stored size: 358 Bytes

Contents

module RevealCK
  #
  # Public: A FileStringReplacer knows how to replace one string
  # in a file with another.
  #
  class FileStringReplacer

    def self.replace!(file, args)
      old, new = args[:old], args[:new]
      lines = File.open(file).read
      lines = lines.sub old, new
      File.open(file, 'w') { |file| file << lines }
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
reveal-ck-0.1.6 lib/reveal-ck/file_string_replacer.rb