Sha256: c93e34dc0095f67566e8b6f0fb727d78bbc90f4751069561f7ebb92bf82a4f92

Contents?: true

Size: 625 Bytes

Versions: 32

Compression:

Stored size: 625 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module EacTemplates
  module Variables
    module Providers
      require_sub __FILE__

      PROVIDERS = %w[config_reader entries_reader hash generic].map do |name|
        "eac_templates/variables/providers/#{name}".camelize.constantize
      end

      class << self
        def build(variables_source)
          PROVIDERS.each do |provider|
            return provider.new(variables_source) if provider.accept?(variables_source)
          end

          raise "Variables provider not found for #{variables_source}"
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
eac_templates-0.7.1 lib/eac_templates/variables/providers.rb
eac_tools-0.93.0 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_templates-0.7.0 lib/eac_templates/variables/providers.rb
eac_tools-0.91.0 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_templates-0.5.1 lib/eac_templates/variables/providers.rb
eac_tools-0.76.0 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.75.2 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.75.1 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.75.0 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.74.1 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.74.0 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.73.0 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.72.0 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.70.1 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.70.0 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.69.1 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.69.0 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.68.0 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.67.1 sub/eac_templates/lib/eac_templates/variables/providers.rb
eac_tools-0.67.0 sub/eac_templates/lib/eac_templates/variables/providers.rb