summaryrefslogtreecommitdiff
path: root/lib/chef/resource/file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource/file.rb')
-rw-r--r--lib/chef/resource/file.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb
index 16491f9bc8..53a6a160af 100644
--- a/lib/chef/resource/file.rb
+++ b/lib/chef/resource/file.rb
@@ -20,6 +20,7 @@
require 'chef/resource'
require 'chef/platform/query_helpers'
require 'chef/mixin/securable'
+require 'chef/resource/file/verification'
class Chef
class Resource
@@ -50,6 +51,7 @@ class Chef
@force_unlink = false
@manage_symlink_source = nil
@diff = nil
+ @verifications = []
end
def content(arg=nil)
@@ -115,6 +117,18 @@ class Chef
:kind_of => [ TrueClass, FalseClass ]
)
end
+
+ def verify(command=nil, opts={}, &block)
+ if ! (command.nil? || [String, Symbol].include?(command.class))
+ raise ArgumentError, "verify requires either a string, symbol, or a block"
+ end
+
+ if command || block_given?
+ @verifications << Verification.new(self, command, opts, &block)
+ else
+ @verifications
+ end
+ end
end
end
end