Sha256: 4b3622d3dc900cbe2d43b8c920827d262ada8c07f04e05e98a6a9673fc8245f6

Contents?: true

Size: 964 Bytes

Versions: 24

Compression:

Stored size: 964 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'
require 'eac_ruby_utils/yaml'
require 'shellwords'

module Avm
  module Sources
    class Base
      module Configuration
        # @return [Array<String>, nil]
        def read_configuration_as_shell_words(key)
          configuration[key].if_present do |v|
            v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v.to_s)
          end
        end

        private

        # @return [Hash]
        def configuration_uncached
          ::Avm::Sources::Configuration::FILENAMES.each do |filename|
            file_path = path.join(filename)
            return ::EacRubyUtils::Yaml.load_file(file_path).with_indifferent_access if
            file_path.exist?
          end
          {}
        end

        # @return [Avm::Sources::Configuration]
        def old_configuration_uncached
          ::Avm::Sources::Configuration.find_in_path(path)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
avm-tools-0.116.2 sub/avm/lib/avm/sources/base/configuration.rb
avm-0.18.1 lib/avm/sources/base/configuration.rb
avm-0.18.0 lib/avm/sources/base/configuration.rb
avm-tools-0.116.1 sub/avm/lib/avm/sources/base/configuration.rb
avm-tools-0.116.0 sub/avm/lib/avm/sources/base/configuration.rb
avm-0.17.0 lib/avm/sources/base/configuration.rb
avm-tools-0.115.0 sub/avm/lib/avm/sources/base/configuration.rb
avm-0.16.0 lib/avm/sources/base/configuration.rb
avm-tools-0.114.2 sub/avm/lib/avm/sources/base/configuration.rb
avm-0.15.0 lib/avm/sources/base/configuration.rb
avm-tools-0.114.1 sub/avm/lib/avm/sources/base/configuration.rb
avm-tools-0.114.0 sub/avm/lib/avm/sources/base/configuration.rb
avm-tools-0.113.6 sub/avm/lib/avm/sources/base/configuration.rb
avm-0.14.0 lib/avm/sources/base/configuration.rb
avm-tools-0.113.5 sub/avm/lib/avm/sources/base/configuration.rb
avm-0.13.0 lib/avm/sources/base/configuration.rb
avm-tools-0.113.4 sub/avm/lib/avm/sources/base/configuration.rb
avm-0.12.1 lib/avm/sources/base/configuration.rb
avm-tools-0.113.3 sub/avm/lib/avm/sources/base/configuration.rb
avm-0.12.0 lib/avm/sources/base/configuration.rb