Class: Puppet_X::Coi::Jboss::Internal::Sanitizer
- Inherits:
-
Object
- Object
- Puppet_X::Coi::Jboss::Internal::Sanitizer
- Defined in:
- lib/puppet_x/coi/jboss/internal/sanitizer.rb
Overview
Class that evaluates given content, jboss console output, and replaces every tuple entry with curly braces
Constant Summary collapse
- REGEXP =
It`s some kind of magic: regex101.com/r/uE3vD6/1
Regexp.new('[\n\s]*=>[\n\s]*\[[\n\s]*(\([^\]]+\))[\n\s]*\]', Regexp::MULTILINE)
Instance Method Summary collapse
-
#sanitize(content) ⇒ Hash
Method that evaluate given String.
Instance Method Details
#sanitize(content) ⇒ Hash
Method that evaluate given String
8 9 10 11 12 13 |
# File 'lib/puppet_x/coi/jboss/internal/sanitizer.rb', line 8 def sanitize(content) # JBoss expression and Long value handling content.gsub!(/expression \"(.+)\",/, '\'\1\',') content.gsub!(/=> (\d+)L/, '=> \1') evaluate(content) end |