Sha256: 62d38dd333404328e2759284440bcc69113d30a40e317f7512d8480781ee5f26

Contents?: true

Size: 798 Bytes

Versions: 15

Compression:

Stored size: 798 Bytes

Contents

class Lono::Extensions
  module Loader
    include Lono::Template::Context::Loader::LoadFiles

    def load_all_extension_helpers
      Lono::Jade::Registry.tracked_extensions.each do |registry|
        load_extension_helpers(registry)
      end
    end

    def load_extension_helpers(registry)
      root = find_extensions_root_path(registry)
      extension_file = "#{root}/lib/#{registry.name}"
      require extension_file
      helpers_path = "#{root}/lib/#{registry.name}/helpers"
      load_files(helpers_path)
    end

    #
    #     1. vendor/extensions
    #     2. normal gem
    #     3. materialized gem
    #
    def find_extensions_root_path(registry)
      @finder ||= Lono::Finder::Extension.new
      jadespec = @finder.find(registry.name)
      jadespec.root
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
lono-7.5.2 lib/lono/extensions/loader.rb
lono-7.5.1 lib/lono/extensions/loader.rb
lono-7.5.0 lib/lono/extensions/loader.rb
lono-7.4.11 lib/lono/extensions/loader.rb
lono-7.4.10 lib/lono/extensions/loader.rb
lono-7.4.9 lib/lono/extensions/loader.rb
lono-7.4.8 lib/lono/extensions/loader.rb
lono-7.4.7 lib/lono/extensions/loader.rb
lono-7.4.6 lib/lono/extensions/loader.rb
lono-7.4.5 lib/lono/extensions/loader.rb
lono-7.4.4 lib/lono/extensions/loader.rb
lono-7.4.3 lib/lono/extensions/loader.rb
lono-7.4.2 lib/lono/extensions/loader.rb
lono-7.4.1 lib/lono/extensions/loader.rb
lono-7.4.0 lib/lono/extensions/loader.rb