Sha256: ba39b3f7ef481122347e34b2329b755445da576a189567b36b479e10c0581e33

Contents?: true

Size: 645 Bytes

Versions: 24

Compression:

Stored size: 645 Bytes

Contents

module Sprinkle
  module Verifiers
    # = 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'}
    #
    module File
      Sprinkle::Verify.register(Sprinkle::Verifiers::File)
      
      # Checks to make sure <tt>path</tt> is a file on the remote server.
      def has_file(path)
        @commands << "test -f #{path}"
      end
      
      def file_contains(path, text)
        @commands << "grep '#{text}' #{path}"
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 8 rubygems

Version Path
crafterm-sprinkle-0.2.1 lib/sprinkle/verifiers/file.rb
crafterm-sprinkle-0.2.2 lib/sprinkle/verifiers/file.rb
crafterm-sprinkle-0.2.3 lib/sprinkle/verifiers/file.rb
crafterm-sprinkle-0.2.4 lib/sprinkle/verifiers/file.rb
crafterm-sprinkle-0.2.5 lib/sprinkle/verifiers/file.rb
crafterm-sprinkle-0.2.6 lib/sprinkle/verifiers/file.rb
jemmyw-sprinkle-0.2.3 lib/sprinkle/verifiers/file.rb
jemmyw-sprinkle-0.2.4 lib/sprinkle/verifiers/file.rb
justsee-sprinkle-0.2.4 lib/sprinkle/verifiers/file.rb
mdwan-sprinkle-0.2.2 lib/sprinkle/verifiers/file.rb
mdwan-sprinkle-0.2.3 lib/sprinkle/verifiers/file.rb
trevorturk-sprinkle-0.2.2 lib/sprinkle/verifiers/file.rb
trevorturk-sprinkle-0.2.6 lib/sprinkle/verifiers/file.rb
powcloud-sprinkle-0.3.4 lib/sprinkle/verifiers/file.rb
powcloud-sprinkle-0.3.0 lib/sprinkle/verifiers/file.rb
sprinkle-0.3.1 lib/sprinkle/verifiers/file.rb
sprinkle-0.3.0 lib/sprinkle/verifiers/file.rb
maxmpz-sprinkle-0.2.6.1 lib/sprinkle/verifiers/file.rb
sprinkle-0.2.6 lib/sprinkle/verifiers/file.rb
sprinkle-0.2.3 lib/sprinkle/verifiers/file.rb