Class: JavaBuildpackUtils::Properties
- Inherits:
-
Hash
- Object
- Hash
- JavaBuildpackUtils::Properties
- Defined in:
- lib/java-buildpack-utils/properties.rb
Overview
A class representing a collection of Java properties
Instance Method Summary collapse
-
#initialize(file) ⇒ Properties
constructor
Create a new instance, populating it with values from a properties file.
Constructor Details
#initialize(file) ⇒ Properties
Create a new instance, populating it with values from a properties file
22 23 24 25 26 27 28 29 30 |
# File 'lib/java-buildpack-utils/properties.rb', line 22 def initialize(file) File.foreach(file) do |line| unless blank_line?(line) || comment_line?(line) if line =~ /^[\s]*([^:=\s]+)[\s]*[=:]?[\s]*([^:=\s]*)$/ self[$1] = $2 end end end end |