lib/ohai/dsl/plugin.rb
# Set the value equal to the stdout of the command, plus
# run through a regex - the first piece of match data is\
# the value.
Set the value equal to the stdout of the command, plus
run through a regex - the first piece of match data is\
the value.
Set the value equal to the stdout of the command plus run through a regex - the first piece of match data is \ the value .
def from_with_regex(cmd, *regex_list)
        regex_list.flatten.each do |regex|
          _status, stdout, _stderr = run_command(:command => cmd)
          return "" if stdout.nil? || stdout.empty?
          stdout.chomp!.strip
          md = stdout.match(regex)
          return md[1]
        end
      end
def from_with_regex ( cmd , * regex_list ) regex_list . flatten . each do | regex | _status , stdout , _stderr = run_command ( :command => cmd ) return "" if stdout . nil? || stdout . empty? stdout . chomp! . strip md = stdout . match ( regex ) return md [ 1 ] end end
Set the value equal to the stdout of the command, plus
run through a regex - the first piece of match data is\
the value.
Set the value equal to the stdout of the command plus run through a regex - the first piece of match data is \ the value .
cmd
regex_list