+
+ def available_sources(format = false)
+ path_root = File.expand_path(File.dirname(__FILE__))
+ sources = Dir[path_root+"/sources/*.rb"].map{ |s|
+ name = s.split("/").last.gsub(/\.rb/, "")
+
+ # Add a star to denote enabled sources
+ name
+ }
+
+ # Remove arguments (Hack?) We don't want anybody to touch tihs one.
+ sources.delete("arguments")
+ if format
+ format_sources(sources)
+ else
+ sources
+ end
+ end
+
+ def format_sources(sources)
+ sources.map{ |s|
+ s << "*" if @config["enabled_sources"].include?(s)
+ s
+ }
+ end