Sha256: b302ab88ed5bf2f72c666d5579d74c41d5e480fda763e11992df69a1960b69d1

Contents?: true

Size: 613 Bytes

Versions: 41

Compression:

Stored size: 613 Bytes

Contents

require 'serverspec'
require 'serverspec/type/base'

module Serverspec::Type
  class JavaPropertyFile < Base

    def initialize(name)
      @name = name
      @runner = Specinfra::Runner
    end

    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
  end

  def java_property_file(name)
    JavaPropertyFile.new(name)
  end
end

include Serverspec::Type

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
octopus-serverspec-extensions-0.6.0 lib/octopus_serverspec_extensions/type/java_property_file.rb