Sha256: bcb3f65ce89b4855a0d0964cd8d584d766470ac5b93b8d46ef2e5cd9d45b1342

Contents?: true

Size: 843 Bytes

Versions: 12

Compression:

Stored size: 843 Bytes

Contents

# encoding: utf-8

require 'utils/command_wrapper'
require 'resources/command'

module Inspec::Resources
  class Ksh < Cmd
    name 'ksh'
    supports platform: 'unix'
    desc 'Run a command or script in KornShell.'
    example <<~EXAMPLE
      describe ksh('ls -al /') do
        its('stdout') { should match /bin/ }
        its('stderr') { should eq '' }
        its('exit_status') { should eq 0 }
      end

      # Specify the path of the executable:
      ksh('...', path: '/usr/bin/ksh93')

      # Specify arguments (defaults to -c)
      ksh('...', args: '-x -c')
    EXAMPLE

    def initialize(command, options = {})
      @raw_command = command
      options[:shell] = 'ksh' if options.is_a?(Hash)
      super(CommandWrapper.wrap(command, options))
    end

    def to_s
      "KornShell command #{@raw_command}"
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
inspec-core-4.3.2 lib/resources/ksh.rb
inspec-4.3.2 lib/resources/ksh.rb
inspec-core-4.2.0.preview lib/resources/ksh.rb
inspec-4.2.0.preview lib/resources/ksh.rb
inspec-core-4.1.4.preview lib/resources/ksh.rb
inspec-4.1.4.preview lib/resources/ksh.rb
inspec-core-3.9.3 lib/resources/ksh.rb
inspec-3.9.3 lib/resources/ksh.rb
inspec-core-3.9.0 lib/resources/ksh.rb
inspec-3.9.0 lib/resources/ksh.rb
inspec-core-3.7.11 lib/resources/ksh.rb
inspec-3.7.11 lib/resources/ksh.rb