Module: ProperProperties::Parsing::Normalizer

Defined in:
lib/proper_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)


68
69
70
71
72
73
# File 'lib/proper_properties/parsing/normalizer.rb', line 68

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