Module: Orchparty::Plugin

Defined in:
lib/orchparty/plugin.rb,
lib/orchparty/plugins/env.rb

Defined Under Namespace

Modules: Env

Class Method Summary collapse

Class Method Details

.load_plugin(name) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/orchparty/plugin.rb', line 7

def self.load_plugin(name)
  require "orchparty/plugins/#{name}"
  raise "Plugin didn't correctly register itself" unless @plugins[name]

  @plugins[name]
rescue LoadError
  puts "could not load the plugin #{name}, you might install it as a gem or you need to write it by your self ;)"
  false
end

.pluginsObject



17
18
19
# File 'lib/orchparty/plugin.rb', line 17

def self.plugins
  @plugins
end

.register_plugin(name, mod) ⇒ Object



21
22
23
# File 'lib/orchparty/plugin.rb', line 21

def self.register_plugin(name, mod)
  @plugins[name] = mod
end