Class: Package

Inherits:
Object
  • Object
show all
Defined in:
lib/teuton/case_manager/case/builtin/package.rb

Instance Method Summary collapse

Constructor Details

#initialize(teuton_host, param) ⇒ Package

Returns a new instance of Package.



3
4
5
6
7
8
# File 'lib/teuton/case_manager/case/builtin/package.rb', line 3

def initialize(teuton_host, param)
  @teuton_host = teuton_host
  @parent = teuton_host.parent
  @host = teuton_host.host
  @param = param
end

Instance Method Details

#installed?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
# File 'lib/teuton/case_manager/case/builtin/package.rb', line 10

def installed?
  @parent.target("Package #{@param} installed?")
  @parent.run "whereis #{@param}", on: @host
  @parent.expect_one [ 'bin', @param ]
end

#not_installed?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
# File 'lib/teuton/case_manager/case/builtin/package.rb', line 16

def not_installed?
  @parent.target("Package #{@param} not installed?")
  @parent.run "whereis #{@param}", on: @host
  @parent.expect_none [ 'bin' , @param ]
end