summaryrefslogtreecommitdiff
path: root/lib/dslkeywords/resource.rb
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-02-19 22:09:52 +0200
committerPaul Buetow <paul@buetow.org>2025-02-19 22:09:52 +0200
commit1afd39cccdb17e5f5c064b376db61d7c2b833ed3 (patch)
treef2c59dee57795dae643f9b14bd188382e8a07631 /lib/dslkeywords/resource.rb
parent1f085e83f018048931079e9bf0a564b461fd713c (diff)
adding dry
Diffstat (limited to 'lib/dslkeywords/resource.rb')
-rw-r--r--lib/dslkeywords/resource.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/dslkeywords/resource.rb b/lib/dslkeywords/resource.rb
index aea47cc..8bf62e1 100644
--- a/lib/dslkeywords/resource.rb
+++ b/lib/dslkeywords/resource.rb
@@ -38,6 +38,16 @@ module RCM
end
def requires?(*others) = others.flatten.none? { |other| !@requires&.include?(other) }
+
+ # Only run the block when not in dry mode
+ def dry?(message)
+ if option :dry
+ info("#{message} - dry run!")
+ return
+ end
+ info(message)
+ yield
+ end
end
# To resolve dependencies