Module: JavaProperties::Parsing::Normalizer

Defined in:
lib/java-properties/parsing/normalizer.rb

Overview

Module to normalize the content of a properties file

Examples:

Normalizes:

# Comment 1
! Comment 2
item0
item1 = item1 
item2 : item2 
item3=line 1 \
      line 2

Into:


item0
item1=item1 
item2=item2 
item3=line 1 line 2

Defined Under Namespace

Classes: Rule

Constant Summary collapse

RULES =

Collection of ordered rules

[]

Class Method Summary collapse

Class Method Details

.normalize!(text) ⇒ String

Normalizes the content of a properties file content by applying the RULES

Parameters:

  • text (String)

Returns:

  • (String)

65
66
67
68
69
70
# File 'lib/java-properties/parsing/normalizer.rb', line 65

def self.normalize!(text)
  RULES.each do |rule|
    rule.apply!(text)
  end
  text
end