Sha256: f80938c67669186dc03b6a6941eb2ee7efa909d00664662a61a67bb6b63dc7fd

Contents?: true

Size: 893 Bytes

Versions: 16

Compression:

Stored size: 893 Bytes

Contents

class Specinfra::Command::Solaris::Base::File < Specinfra::Command::Base::File
  class << self
    def check_contains_within(file, expected_pattern, from=nil, to=nil)
      from ||= '1'
      to ||= '$'
      sed = "sed -n #{escape(from)},#{escape(to)}p #{escape(file)}"
      checker_with_regexp = check_file_contains_with_regexp("/dev/stdin", expected_pattern)
      checker_with_fixed  = check_file_contains_with_fixed_strings("/dev/stdin", expected_pattern)
      "#{sed} | #{checker_with_regexp} || #{sed} | #{checker_with_fixed}"
    end

    def check_is_accessible_by_user(file, user, access)
      # http://docs.oracle.com/cd/E23823_01/html/816-5166/su-1m.html
      ## No need for login shell as it seems that behavior as superuser is favorable for us, but needs
      ## to be better tested under real solaris env
      "su #{user} -c \"test -#{access} #{file}\""
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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