Sha256: ca84b477257ea91ae1acb095e459173adf3842831b21833ab0e38e3ee5a9250b
Contents?: true
Size: 1.82 KB
Versions: 27
Compression:
Stored size: 1.82 KB
Contents
# frozen_string_literal: true module Script module Layers module Domain class ExtensionPoint attr_reader :type, :beta, :deprecated, :libraries, :domain def initialize(type, config) @type = type @beta = config["beta"] || false @deprecated = config["deprecated"] || false @domain = config["domain"] || nil @libraries = ExtensionPointLibraries.new(config["libraries"]) end def beta? @beta end def stable? !beta? end def deprecated? @deprecated end def dasherize_type @type.gsub("_", "-") end def library_languages(include_betas: false) @libraries.all.map do |library| include_betas || library.stable? ? library.language : nil end.compact end class ExtensionPointLibraries def initialize(config) @config = config end def all @all ||= @config.map do |language, library_config| ExtensionPointLibrary.new(language, library_config) end end def for(language) all.find { |ep| ep.language == language } end end class ExtensionPointLibrary attr_reader :language, :version, :beta, :package, :repo def initialize(language, config) @language = language @beta = config["beta"] || false @package = config["package"] @version = config["package-version"] @repo = config["repo"] end def beta? @beta end def stable? !beta? end def versioned? @version end end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems