Class: AppCfg::PropertiesSource

Inherits:
Source
  • Object
show all
Defined in:
lib/appcfg/sources/properties_source.rb

Overview

TODO: consider treating . in properties names as a nesting operatator. E.g. maven.groupId=xyz creates AppCfg = { ‘groupId’ => ‘xyz’ } TODO: environment support? Perhaps file-name convention or also with .-delimited properties names? E.g. maven.groupId.test

Instance Method Summary collapse

Methods inherited from Source

add, clear, list, reload_sources!, #to_hash

Constructor Details

#initialize(options = {}) ⇒ PropertiesSource

Returns a new instance of PropertiesSource.



7
8
9
10
# File 'lib/appcfg/sources/properties_source.rb', line 7

def initialize(options = {})
  @filename = options[:file]
  @namespace = options[:env]
end

Instance Method Details

#reload_data!Object



12
13
14
15
# File 'lib/appcfg/sources/properties_source.rb', line 12

def reload_data!
  properties = JavaProperties.new(@filename)
  @hash = properties.properties
end