lib/rake/funnel/support/patch.rb in rake-funnel-0.22.2 vs lib/rake/funnel/support/patch.rb in rake-funnel-0.22.3
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Rake
module Funnel
module Support
class Patch
def initialize(context = nil)
@@ -16,16 +18,18 @@
@reset = block
end
def apply!
return self if @memo
+
@memo = (@setup || noop).call(@context)
self
end
def revert!
return self unless @memo
+
(@reset || noop).call(@memo)
@memo = nil
self
end