Sha256: f73896b7eb135b0778992ba17f533bfe35a93c6bb5027c02518cf237403ff145

Contents?: true

Size: 503 Bytes

Versions: 3

Compression:

Stored size: 503 Bytes

Contents

module Crystal
  module Plugin
    class App
      attr_reader :dir
      
      def initialize dir
        @dir = dir
      end
      
      def plugins list
        plugins = Array.wrap(list)
        # add to $LOAD_PATH
        # plugins.each{|plugin| $LOAD_PATH << "#{dir}/#{plugin}" unless $LOAD_PATH.include?("#{dir}/#{plugin}")}
        # call plugin's init
        plugins.each{|plugin| require "#{plugin}/config/init" if File.exist? "#{dir}/#{plugin}/config/init.rb"}
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
crystal_ext-0.0.7 lib/crystal_ext/plugin/app.rb
crystal_ext-0.0.5 lib/crystal_ext/plugin/app.rb
crystal_ext-0.0.4 lib/crystal_ext/plugin/app.rb