Sha256: fbeeb75a37b6fb272ed9cd0d1643528a96c95c1be66f7591b9c78f828b57c120

Contents?: true

Size: 428 Bytes

Versions: 5

Compression:

Stored size: 428 Bytes

Contents

module Nesta
  module Plugin
    class << self
      attr_accessor :loaded
    end
    self.loaded ||= []

    def self.register(path)
      name = File.basename(path, '.rb')
      prefix = 'nesta-plugin-'
      name.start_with?(prefix) || raise("Plugin names must match '#{prefix}*'")
      self.loaded << name
    end

    def self.initialize_plugins
      self.loaded.each { |name| require "#{name}/init" }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nesta-0.18.0 lib/nesta/plugin.rb
nesta-0.17.0 lib/nesta/plugin.rb
nesta-0.16.0 lib/nesta/plugin.rb
nesta-0.15.0 lib/nesta/plugin.rb
nesta-0.14.0 lib/nesta/plugin.rb