module EscapeJavaProperties

A module to read and write Escape java properties files

Constants

VERSION

Public Class Methods

generate(hash, options = {}) click to toggle source

Generates the content of a escape java properties file @see Generating::Generator @param hash [Hash] @param options [Hash] options for the generator @return [String]

# File lib/escape_java_properties.rb, line 23
def self.generate(hash, options = {})
  Generating::Generator.generate(hash, options)
end
load(path, encoding = 'UTF-8', allow_invalid_byte_sequence = true) click to toggle source

Loads and parses a escape java properties file @see Parsing::Parser @param path [String] @param encoding [String] @param allow_invalid_byte_sequence [Boolean] @return [Properties]

# File lib/escape_java_properties.rb, line 33
def self.load(path, encoding = 'UTF-8', allow_invalid_byte_sequence = true)
    parse(File.read(path).encode(encoding, 'binary', allow_invalid_byte_sequence ? {invalid: :replace, undef: :replace} : {} ))
end
parse(text) click to toggle source

Parses the content of a escape javaproperties file @see Parsing::Parser @param text [String] @return [Properties]

# File lib/escape_java_properties.rb, line 14
def self.parse(text)
  Parsing::Parser.parse(text)
end
write(hash, path, options = {}) click to toggle source

Generates a escape java properties file @see Generating::Generator @param hash [Hash] @param path [String] @param options [Hash] options for the generator

# File lib/escape_java_properties.rb, line 42
def self.write(hash, path, options = {})
  File.write(path, generate(hash, options))
end