123456789_123456789_123456789_123456789_123456789_

Class: Puma::PluginLoader

Relationships & Source Files
Inherits: Object
Defined in: lib/puma/plugin.rb

Class Method Summary

Instance Method Summary

Constructor Details

.newPluginLoader

[ GitHub ]

  
# File 'lib/puma/plugin.rb', line 7

def initialize
  @instances = []
end

Instance Method Details

#create(name)

Raises:

[ GitHub ]

  
# File 'lib/puma/plugin.rb', line 11

def create(name)
  if cls = Plugins.find(name)
    plugin = cls.new
    @instances << plugin
    return plugin
  end

  raise UnknownPlugin, "File failed to register properly named plugin"
end

#fire_starts(launcher)

[ GitHub ]

  
# File 'lib/puma/plugin.rb', line 21

def fire_starts(launcher)
  @instances.each do |i|
    if i.respond_to? :start
      i.start(launcher)
    end
  end
end