Sha256: 16304edbfbe6dbdc4c19ead2c8a7637c982023bfc7504aaf806b8461d564a9f0

Contents?: true

Size: 935 Bytes

Versions: 43

Compression:

Stored size: 935 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'
require 'eac_ruby_utils/gems_registry'

module Avm
  module Registry
    require_sub __FILE__
    enable_listable
    lists.add_symbol :category, :applications, :application_scms, :application_stereotypes,
                     :config_objects, :file_formats, :instances, :launcher_stereotypes, :runners,
                     :scms, :source_generators, :sources

    class << self
      enable_simple_cache

      # @return [Array<Avm::Registry::FromGems>]
      def registries
        lists.category.values.map { |c| send(c) }
      end

      private

      ::Avm::Registry.lists.category.each_value do |category|
        define_method "#{category}_uncached" do
          registry_class(category).new(category.to_s.camelize)
        end
      end

      def registry_class(category)
        ::Avm::Registry.const_get(category.to_s.camelize)
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 2 rubygems

Version Path
avm-0.94.1 lib/avm/registry.rb
eac_tools-0.98.0 sub/avm/lib/avm/registry.rb
avm-0.94.0 lib/avm/registry.rb
eac_tools-0.94.0 sub/avm/lib/avm/registry.rb
avm-0.93.0 lib/avm/registry.rb
eac_tools-0.92.0 sub/avm/lib/avm/registry.rb
avm-0.92.0 lib/avm/registry.rb
eac_tools-0.91.0 sub/avm/lib/avm/registry.rb
avm-0.90.1 lib/avm/registry.rb
eac_tools-0.87.1 sub/avm/lib/avm/registry.rb
avm-0.90.0 lib/avm/registry.rb
eac_tools-0.87.0 sub/avm/lib/avm/registry.rb
avm-0.89.0 lib/avm/registry.rb
eac_tools-0.86.12 sub/avm/lib/avm/registry.rb
avm-0.88.0 lib/avm/registry.rb
eac_tools-0.86.11 sub/avm/lib/avm/registry.rb
avm-0.87.0 lib/avm/registry.rb
eac_tools-0.86.8 sub/avm/lib/avm/registry.rb
avm-0.86.2 lib/avm/registry.rb
eac_tools-0.86.7 sub/avm/lib/avm/registry.rb