Sha256: 9501ae55c05a9516d9cc06204e815b71af2118b9fc1ab1290cd2102273c02a07

Contents?: true

Size: 997 Bytes

Versions: 54

Compression:

Stored size: 997 Bytes

Contents

class Specinfra::Command::Freebsd::Base::File < Specinfra::Command::Base::File
  class << self
    def check_is_grouped(file, group)
      regexp = "^#{group}$"
      "stat -f%Sg #{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_has_mode(file, mode)
      regexp = "^#{mode}$"
      "stat -f%Lp #{escape(file)} | grep -- #{escape(regexp)}"
    end

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

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

    def get_mtime(file)
      "stat -f%m #{escape(file)}"
    end

    def get_size(file)
      "stat -f%z #{escape(file)}"
    end

    def get_sha256sum(file)
        "sha256 #{escape(file)} | cut -d ' ' -f 4"
    end

    def get_md5sum(file)
        "md5 #{escape(file)} | cut -d ' ' -f 4"
    end
  end
end

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
specinfra-cisco-2.41.0 lib/specinfra/command/freebsd/base/file.rb
specinfra-cisco-2.40.2 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.43.6 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.43.5 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.43.4 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.43.3 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.43.2 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.43.1 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.43.0 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.42.2 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.42.1 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.42.0 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.41.1 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.41.0 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.40.2 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.40.1 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.40.0 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.39.1 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.39.0 lib/specinfra/command/freebsd/base/file.rb
specinfra-2.38.1 lib/specinfra/command/freebsd/base/file.rb