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
avm-0.94.1 lib/avm/registry/with_path/cache.rb
eac_tools-0.98.0 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.94.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.94.0 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.93.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.92.0 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.92.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.91.0 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.90.1 lib/avm/registry/with_path/cache.rb
eac_tools-0.87.1 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.90.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.87.0 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.89.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.86.12 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.88.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.86.11 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.87.0 lib/avm/registry/with_path/cache.rb
eac_tools-0.86.8 sub/avm/lib/avm/registry/with_path/cache.rb
avm-0.86.2 lib/avm/registry/with_path/cache.rb
eac_tools-0.86.7 sub/avm/lib/avm/registry/with_path/cache.rb