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.18.1 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.18.0 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.17.3 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.17.2 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.17.1 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.17.0 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.15.5 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.15.4 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.15.3 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.15.2 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.15.1 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.15.0 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.13.6 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.13.5 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.13.4 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.13.3 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.13.2 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.13.1 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.13.0 lib/octopus_serverspec_extensions/type/java_property_file.rb
octopus-serverspec-extensions-0.12.2 lib/octopus_serverspec_extensions/type/java_property_file.rb