Module: Duty::Plugins

Defined in:
lib/duty/plugins.rb

Defined Under Namespace

Classes: List, Plugin

Class Method Summary collapse

Class Method Details

.load(filename) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/duty/plugins.rb', line 6

def self.load(filename)
  Duty::Plugins::List.new.tap do |list|
    if File.exists?(filename)
      duty_config = YAML.load(File.read(filename))
      tasks = duty_config["tasks"]
      tasks.each do |namespace, plugin_entry_point|
        list << Plugin.new(namespace, plugin_entry_point)
      end
    end
  end
end