Class: Dply::Pkgs

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/dply/pkgs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#cmd, #error, #git, #logger, #sh, #symlink

Constructor Details

#initialize(pkgs_yml) ⇒ Pkgs

Returns a new instance of Pkgs.



12
13
14
15
# File 'lib/dply/pkgs.rb', line 12

def initialize(pkgs_yml)
  @pkgs_yml = pkgs_yml
  read_config
end

Instance Attribute Details

#allObject (readonly)

Returns the value of attribute all.



10
11
12
# File 'lib/dply/pkgs.rb', line 10

def all
  @all
end

#buildObject (readonly)

Returns the value of attribute build.



10
11
12
# File 'lib/dply/pkgs.rb', line 10

def build
  @build
end

#runtimeObject (readonly)

Returns the value of attribute runtime.



10
11
12
# File 'lib/dply/pkgs.rb', line 10

def runtime
  @runtime
end

Instance Method Details

#install(build_mode: false) ⇒ Object



17
18
19
20
# File 'lib/dply/pkgs.rb', line 17

def install(build_mode: false)
  pkgs = build_mode ? @all : @runtime
  Yum.install pkgs
end

#installed?(build_mode: false) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
# File 'lib/dply/pkgs.rb', line 22

def installed?(build_mode: false)
  pkgs = build_mode ? @all : @runtime
  Yum.installed? pkgs
end