Sha256: 28d85612c9e4da2b03b28ffd8981a04d640e92bcf4212ded86beb359899ef70a

Contents?: true

Size: 216 Bytes

Versions: 8

Compression:

Stored size: 216 Bytes

Contents

# frozen_string_literal: true

module Refinements
  module Files
    refine File.singleton_class do
      def rewrite path
        read(path).then { |content| write path, yield(content) }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
refinements-7.4.0 lib/refinements/files.rb
refinements-7.3.0 lib/refinements/files.rb
refinements-7.2.0 lib/refinements/files.rb
refinements-7.1.0 lib/refinements/files.rb
refinements-7.0.0 lib/refinements/files.rb
refinements-6.3.2 lib/refinements/files.rb
refinements-6.3.1 lib/refinements/files.rb
refinements-6.3.0 lib/refinements/files.rb