- class Util
- class EditedFile < String
- def initialize(file, block)
- @file = file
- @block = block
- end
-
- def to_s
- ::File.new(@file).collect do |line|
- line = @block.call(line)
- end.join("")
+ module Mixin
+ module EditFile
+ def edit_file(file, &_block)
+ Chef::DelayedEvaluator.new do
+ ::File.new(file).collect do |line|
+ yield line
+ end.join("")
+ end