Class: Serverspec::Type::JavaPropertyFile
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::JavaPropertyFile
- Defined in:
- lib/octopus_serverspec_extensions/type/java_property_file.rb
Instance Method Summary collapse
- #has_property?(propertyName, propertyValue) ⇒ Boolean
-
#initialize(name) ⇒ JavaPropertyFile
constructor
A new instance of JavaPropertyFile.
Constructor Details
#initialize(name) ⇒ JavaPropertyFile
Returns a new instance of JavaPropertyFile.
7 8 9 10 |
# File 'lib/octopus_serverspec_extensions/type/java_property_file.rb', line 7 def initialize(name) @name = name @runner = Specinfra::Runner end |
Instance Method Details
#has_property?(propertyName, propertyValue) ⇒ Boolean
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/octopus_serverspec_extensions/type/java_property_file.rb', line 12 def has_property?(propertyName, propertyValue) properties = {} IO.foreach(@name) do |line| if (!line.start_with?('#')) properties[$1.strip] = $2 if line =~ /([^=]*)=(.*)/ end end properties[propertyName] == propertyValue end |