Sha256: 2c20976ea506dfcc30e7d3e0f3f1f0c8467c0463af530999e032e295c8a78a75

Contents?: true

Size: 211 Bytes

Versions: 4

Compression:

Stored size: 211 Bytes

Contents

# frozen_string_literal: true

require "pathname"

module Refinements
  module Pathnames
    refine Pathname do
      def rewrite
        read.then { |content| write yield(content) }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
refinements-7.0.0 lib/refinements/pathnames.rb
refinements-6.3.2 lib/refinements/pathnames.rb
refinements-6.3.1 lib/refinements/pathnames.rb
refinements-6.3.0 lib/refinements/pathnames.rb