lib/licensed/configuration.rb in licensed-1.5.2 vs lib/licensed/configuration.rb in licensed-2.0.0
- old
+ new
@@ -7,19 +7,14 @@
DEFAULT_CONFIG_FILES = [
".licensed.yml".freeze,
".licensed.yaml".freeze,
".licensed.json".freeze
].freeze
- SOURCE_TYPES = Source.constants.map { |c| Source.const_get(c) }.freeze
- attr_reader :ui
-
def initialize(options = {}, inherited_options = {})
super()
- @ui = Licensed::UI::Shell.new
-
# update order:
# 1. anything inherited from root config
# 2. app defaults
# 3. explicitly configured app settings
update(inherited_options)
@@ -59,12 +54,12 @@
Pathname.pwd
end
# Returns an array of enabled app sources
def sources
- @sources ||= SOURCE_TYPES.select { |source_class| enabled?(source_class.type) }
- .map { |source_class| source_class.new(self) }
- .select(&:enabled?)
+ @sources ||= Licensed::Sources::Source.sources
+ .select { |source_class| enabled?(source_class.type) }
+ .map { |source_class| source_class.new(self) }
end
# Returns whether a source type is enabled
def enabled?(source_type)
# the default is false if any sources are set to true, true otherwise