Class: Puppet_X::Coi::Jboss::Internal::CommandCompilator

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_x/coi/jboss/internal/command_compilator.rb

Overview

Class that handles compilation of commands

Instance Method Summary collapse

Instance Method Details

#compile(runasdomain, profile, cmd) ⇒ String

Method that adds profile and neccesary stuff

Parameters:

  • runasdomain (Boolean)

    if jbosss in in domain module

  • profile (String)

    name of profile

  • cmd (String)

    command that will be executed

Returns:

  • (String)

    command that is ready to be executed



8
9
10
11
12
13
14
# File 'lib/puppet_x/coi/jboss/internal/command_compilator.rb', line 8

def compile(runasdomain, profile, cmd)
  out = cmd.to_s
  convr = Puppet_X::Coi::Jboss::BuildinsUtils::ToBooleanConverter.new(runasdomain)
  asdomain = convr.to_bool
  out = "/profile=#{profile}#{out}" if asdomain && out[0..9] == '/subsystem'
  out
end