Class: OsCtl::Image::Operations::Config::ParseList

Inherits:
Base
  • Object
show all
Includes:
Lib::Utils::Log, Lib::Utils::System
Defined in:
lib/osctl/image/operations/config/parse_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

run

Constructor Details

#initialize(base_dir, type) ⇒ ParseList

Returns a new instance of ParseList.

Parameters:

  • base_dir (String)
  • type (:builder, :image)


17
18
19
20
21
# File 'lib/osctl/image/operations/config/parse_list.rb', line 17

def initialize(base_dir, type)
  super()
  @base_dir = base_dir
  @type = type
end

Instance Attribute Details

#base_dirString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/osctl/image/operations/config/parse_list.rb', line 10

def base_dir
  @base_dir
end

#typeSymbol (readonly)

Returns:

  • (Symbol)


13
14
15
# File 'lib/osctl/image/operations/config/parse_list.rb', line 13

def type
  @type
end

Instance Method Details

#executeArray<String>

Returns:

  • (Array<String>)

Raises:

  • (OsCtl::Lib::SystemCommandFailed)


25
26
27
28
29
30
31
# File 'lib/osctl/image/operations/config/parse_list.rb', line 25

def execute
  syscmd([
    File.join(base_dir, 'bin', 'config'),
    type.to_s,
    'list'
  ].join(' ')).output.split("\n")
end