Module: JCF::Plugins

Defined in:
lib/jcf/cli.rb,
lib/jcf/plugins/aws_s3.rb,
lib/jcf/plugins/aws_rds.rb

Defined Under Namespace

Classes: AwsRds, AwsS3

Class Method Summary collapse

Class Method Details

.load_plugin(name) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/jcf/cli.rb', line 43

def self.load_plugin(name)
  return @plugins[name] if @plugins[name]

  puts "Loading plugin #{name}" if ENV["DEBUG"]
  require "jcf/plugins/#{name}"
  raise "Plugin didn't correctly register itself" unless @plugins[name]

  @plugins[name]
end

.pluginsObject



39
40
41
# File 'lib/jcf/cli.rb', line 39

def self.plugins
  @plugins
end

.register_plugin(name, mod) ⇒ Object

Plugins need to call this method to register themselves:

JCF::Plugins.register_plugin :render, Render


56
57
58
59
# File 'lib/jcf/cli.rb', line 56

def self.register_plugin(name, mod)
  puts "Registering plugin #{name}" if ENV["DEBUG"]
  @plugins[name] = mod
end