Sha256: b9e3c3ed7772b2a27d6ddd604edf8ea8d921fda938dddd9bd6e53350181a2439

Contents?: true

Size: 1.08 KB

Versions: 14

Compression:

Stored size: 1.08 KB

Contents

class Specinfra::Command::Openbsd::Base::File < Specinfra::Command::Base::File
  class << self
    def check_has_md5checksum(file, expected)
      regexp = "^#{expected}"
      "cksum -qa md5 #{escape(file)} | grep -w #{escape(regexp)}"
    end

    def check_has_sha256checksum(file, expected)
      regexp = "^#{expected}"
      "cksum -qa sha256 #{escape(file)} | grep -w #{escape(regexp)}"
    end

    def check_is_linked_to(link, target)
      "stat -f %Y #{escape(link)} | grep -- #{escape(target)}"
    end

    def check_has_mode(file, mode)
      regexp = "^#{mode}$"
      "stat -f%Lp #{escape(file)} | grep #{escape(regexp)}"
    end

    def check_is_owned_by(file, owner)
      regexp = "^#{owner}$"
      "stat -f %Su #{escape(file)} | grep -- #{escape(regexp)}"
    end

    def check_is_grouped(file, group)
      regexp = "^#{group}$"
      "stat -f %Sg #{escape(file)} | grep -- #{escape(regexp)}"
    end

    def check_is_mounted(path)
      regexp = "on #{path} "
      "mount | grep #{escape(regexp)}"
    end

    def get_mode(file)
      "stat -f%Lp #{escape(file)}"
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
specinfra-2.0.0.beta29 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta28 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta27 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta26 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta25 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta24 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta23 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta22 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta21 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta20 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta19 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta18 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta17 lib/specinfra/command/openbsd/base/file.rb
specinfra-2.0.0.beta16 lib/specinfra/command/openbsd/base/file.rb