]>
git.r.bdr.sh - rbdr/lyricli.rb/blob - lib/source_manager.rb
834326d0375c96a1ef0fac9241b0c51e34a820b3
8 @config = Lyricli
::Config
11 def enable(source_name
)
12 if source_module
= module_exists
?(camelize(str
))
14 @config[:enabled_sources] << klass
.name
16 raise Lyricli
::EnableSourceException
20 def disable(source_name
)
21 if source_module
= module_exists
?(camelize(str
))
22 @config[:enabled_sources].delete(klass
.name
)
24 raise Lyricli
::DisableSourceException
28 def reset(source_name
)
29 if source_module
= module_exists
?(camelize(str
))
33 raise Lyricli
::ResetSourceException
38 @config[:enabled_sources].each
do |source
|
42 fail
"Source #{source.name} has failed to start. Please reset the source by running `#{$0} source reset #{source.name}.`"