Module: Sprinkle::Verifiers::File

Defined in:
lib/sprinkle/verifiers/file.rb

Overview

File Verifier

Contains a verifier to check the existance of a file.

Example Usage

verify { has_file '/etc/apache2/apache2.conf' }

verify { file_contains '/etc/apache2/apache2.conf', 'mod_gzip'}

Instance Method Summary collapse

Instance Method Details

#file_contains(path, text) ⇒ Object



21
22
23
# File 'lib/sprinkle/verifiers/file.rb', line 21

def file_contains(path, text)
  @commands << "grep '#{text}' #{path}"
end

#has_file(path) ⇒ Object

Checks to make sure path is a file on the remote server.



17
18
19
# File 'lib/sprinkle/verifiers/file.rb', line 17

def has_file(path)
  @commands << "test -f #{path}"
end