lib/puppet_x/coi/jboss/internal/sanitizer.rb
# Method that sanitizes given JBoss DMR string to be JSON loadable
#
# @param content [String] String that will be sanitized
# @return [String] output sanitized string
Method that sanitizes given JBoss DMR string to be JSON loadable
Method that sanitizes given JBoss DMR string to be JSON loadable
def sanitize(content)
    result = content
    result = replace_bytes_repr(result).
             gsub(/expression \"(.+)\"/, "'\\1'").
             gsub(/=> (-?\d+)L/, '=> \1')
    evaluate(result).
      gsub(/\s*=>/, ':').
      gsub(/(:\s*)'([^']+)'/, '\1"\2"').
      gsub(/:\s*undefined/, ': null').
      gsub(/:\s*nil/, ': null').
      gsub(/,(\s+[\}\]])/m, '\1')
  end
def sanitize ( content ) result = content result = replace_bytes_repr ( result ) . gsub ( / expression  \" (.+) \" / , "'\\1'" ) . gsub ( / => (-? \d +)L / , '=> \1' ) evaluate ( result ) . gsub ( / \s *=> / , ':' ) . gsub ( / (: \s *)'([^']+)' / , '\1"\2"' ) . gsub ( / : \s *undefined / , ': null' ) . gsub ( / : \s *nil / , ': null' ) . gsub ( / ,( \s +[ \} \] ]) /m , '\1' ) end
Method that sanitizes given JBoss DMR string to be JSON loadable
Method that sanitizes given JBoss DMR string to be JSON loadable
# JBoss expression and Long value handling
output sanitized string
output sanitized string
String
content
String that will be sanitized
String that will be sanitized