Sha256: e6a71964223ef6c20fe289dcec37679e77ec68c3ee33097b9b086818e07882ac

Contents?: true

Size: 480 Bytes

Versions: 133

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

# :nocov:
module Primer
  module Static
    # :nodoc:
    module GenerateConstants
      class << self
        def call
          Primer::Component.descendants.sort_by(&:name).each_with_object({}) do |component, mem|
            mem[component.to_s] = component.constants(false).sort.each_with_object({}) do |constant, h|
              h[constant] = component.const_get(constant)
            end
          end
        end
      end
    end
  end
end

Version data entries

133 entries across 133 versions & 2 rubygems

Version Path
primer_view_components-0.36.5 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.52.2 lib/primer/static/generate_constants.rb
primer_view_components-0.36.4 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.52.1 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.52.0 lib/primer/static/generate_constants.rb
primer_view_components-0.36.3 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.51.0 lib/primer/static/generate_constants.rb
primer_view_components-0.36.2 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.50.1 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.50.0 lib/primer/static/generate_constants.rb
primer_view_components-0.36.1 lib/primer/static/generate_constants.rb
primer_view_components-0.36.0 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.49.2 lib/primer/static/generate_constants.rb
primer_view_components-0.35.2 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.49.1 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.49.0 lib/primer/static/generate_constants.rb
primer_view_components-0.35.1 lib/primer/static/generate_constants.rb
primer_view_components-0.35.0 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.48.2 lib/primer/static/generate_constants.rb
openproject-primer_view_components-0.48.1 lib/primer/static/generate_constants.rb