Sha256: dd65519b550978bbd5f32fa8c433bbb3bbb2fc34f834d6bc752633fb2415fef8

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

require 'stringio'
require 'java-properties/version'
require 'java-properties/properties'
require 'java-properties/encoding'
require 'java-properties/parsing'
require 'java-properties/generating'

# A module to read and write Java properties files
module JavaProperties

  # Parses the content of a Java properties file
  # @see Parsing::Parser
  # @param text [String]
  # @return [Properties]
  def self.parse(text)
    Parsing::Parser.parse(text)
  end

  # Generates the content of a Java properties file
  # @see Generating::Generator
  # @param hash [Hash] 
  # @param options [Hash] options for the generator
  # @return [String]
  def self.generate(hash, options = {})
    Generating::Generator.generate(hash, options)
  end

  # Loads and parses a Java properties file
  # @see Parsing::Parser
  # @param path [String]
  # @return [Properties]
  def self.load(path)
    parse(File.read(path))
  end

  # Generates a Java properties file
  # @see Generating::Generator
  # @param hash [Hash]
  # @param path [String]
  # @param options [Hash] options for the generator
  def self.write(hash, path, options = {})
    File.write(path, generate(hash, options))
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
java-properties-0.1.0 lib/java-properties.rb
java-properties-0.0.2 lib/java-properties.rb