Sha256: b462e492bb966f3eb914cebd35c64bf5433828fce39383a7ae2ddb5954b2be05

Contents?: true

Size: 689 Bytes

Versions: 212

Compression:

Stored size: 689 Bytes

Contents

# frozen_string_literal: true

require 'avm/registry/from_gems'
require 'eac_ruby_utils/core_ext'

module Avm
  module Registry
    class WithPath < ::Avm::Registry::FromGems
      class Cache
        enable_simple_cache
        common_constructor :owner

        def detect_optional(path)
          return nil if path.root?
          return cached_paths.fetch(path) if cached_paths.key?(path)

          detected = owner.detect_optional(path)
          detected = detect_optional(path.parent) if detected.blank?
          cached_paths[path] = detected
          detected
        end

        private

        def cached_paths_uncached
          {}
        end
      end
    end
  end
end

Version data entries

212 entries across 212 versions & 2 rubygems

Version Path
eac_tools-0.80.0 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.81.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.79.0 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.80.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.78.0 sub/avm/lib/avm/registry/with_path/cache.rb
eac_tools-0.77.1 sub/avm/lib/avm/registry/with_path/cache.rb
eac_tools-0.77.0 sub/avm/lib/avm/registry/with_path/cache.rb
eac_tools-0.76.1 sub/avm/lib/avm/registry/with_path/cache.rb
eac_tools-0.76.0 sub/avm/lib/avm/registry/with_path/cache.rb
eac_tools-0.75.2 sub/avm/lib/avm/registry/with_path/cache.rb
eac_tools-0.75.1 sub/avm/lib/avm/registry/with_path/cache.rb
eac_tools-0.75.0 sub/avm/lib/avm/registry/with_path/cache.rb
eac_tools-0.74.1 sub/avm/lib/avm/registry/with_path/cache.rb
eac_tools-0.74.0 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.79.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.73.0 sub/avm/lib/avm/registry/with_path/cache.rb
eac_tools-0.72.0 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.78.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.70.1 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.77.0 lib/avm/registry/with_path/cache.rb