Method: Pantry#load_plugins

Defined in:
lib/pantry.rb

#load_pluginsObject

Find all installed Pantry plugin gems. Plugins are defined as gems who contain a file named “pantry/init.rb”.



158
159
160
161
162
163
164
165
166
167
168
# File 'lib/pantry.rb', line 158

def load_plugins
  Gem.find_latest_files("pantry/init.rb").each do |path|
    begin
      gem_path = path.gsub("#{Gem.dir}/gems/", '')
      Pantry.logger.debug("Installing plugin from #{gem_path}")
      require path
    rescue Exception => ex
      Pantry.logger.warn("Unable to load plugin at #{gem_path}, #{ex.message}")
    end
  end
end