class Serverspec::Type::JavaPropertyFile

Public Class Methods

new(name) click to toggle source
# File lib/octopus_serverspec_extensions/type/java_property_file.rb, line 7
def initialize(name)
  @name = name
  @runner = Specinfra::Runner
end

Public Instance Methods

has_property?(propertyName, propertyValue) click to toggle source
# 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