lib/licensed/configuration.rb in licensed-4.3.1 vs lib/licensed/configuration.rb in licensed-4.4.0
- old
+ new
@@ -272,18 +272,23 @@
config_path = find_config(config_path) if config_path.directory?
Configuration.new(parse_config(config_path))
end
def initialize(options = {})
+ @options = options
apps = options.delete("apps") || []
apps << default_options.merge(options) if apps.empty?
# apply a root setting to all app configurations so that it's available
# when expanding app source paths
apps.each { |app| app["root"] ||= options["root"] if options["root"] }
apps = apps.flat_map { |app| self.class.expand_app_source_path(app) }
@apps = apps.map { |app| AppConfiguration.new(app, options) }
+ end
+
+ def [](key)
+ @options&.fetch(key, nil)
end
private
def self.expand_app_source_path(app_config)