Sha256: 0f8a02223dd2281ee8791d6572d0e056fa25cc685d569559cf823c935cd0bb4b

Contents?: true

Size: 488 Bytes

Versions: 1

Compression:

Stored size: 488 Bytes

Contents

module Sunzi
  module Plugin
    class << self
      # Find gems that start with "sunzi-*" and require them automatically.
      # If that gem is a plugin, it will call the register method on load.

      def load
        plugins = Gem::Specification.find_all.select{|plugin| plugin.name =~ /sunzi-.+/ }
        plugins.each do |plugin|
          require plugin.name.gsub('-','/')

          Sunzi.thor.source_paths << Pathname.new(plugin.gem_dir)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sunzi-2.0.0 lib/sunzi/plugin.rb