From 06ce663886c56b96ef25b31f0463e2207f7321fd Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 18 Feb 2025 15:34:35 +0200 Subject: add support to delete a file --- lib/dslkeywords/file.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/dslkeywords/file.rb b/lib/dslkeywords/file.rb index 020a97f..41b8cd7 100644 --- a/lib/dslkeywords/file.rb +++ b/lib/dslkeywords/file.rb @@ -56,6 +56,11 @@ module RCM return unless super return evaluate_ensure_line! unless @ensure_line.nil? + if @is == :absent + ::File.delete(@file_path) if ::File.exist?(@file_path) + return + end + write!(real_content) end -- cgit v1.2.3