Sha256: 03648456a2acbc5c0ebde4630f171e273d7973c1754925ea4bd4977c1cb07fa5

Contents?: true

Size: 647 Bytes

Versions: 2

Compression:

Stored size: 647 Bytes

Contents

require 'mack-facets'

run_once do
  
  require File.join_from_here('gems.rb')
  
  init_message('plugins')
  
  plugins = [] # a list of all plugins
  
  Mack.search_path(:plugins).each do |path|
    Dir.glob(File.join(path, '*')).each do |d|
      plugins << d
      $: << File.join(d, 'lib') # add the lib for this plugin to the global load path
    end
  end
  plugins.sort.each do |plug|
    begin
      require File.join(plug, "init.rb") # load the init.rb for each plugin.
    rescue Exception => e
      puts e.message
    end
    $:.delete(File.join(plug, 'lib')) # remove the plugins lib directory from the global load path.
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mack-0.8.3.1 lib/mack/boot/plugins.rb
mack-0.8.3 lib/mack/boot/plugins.rb