Sha256: 1570d13db69510cad4886a40778e72163be9ca0b3ea4f904dfa7e6f3cf173554

Contents?: true

Size: 829 Bytes

Versions: 8

Compression:

Stored size: 829 Bytes

Contents

# frozen_string_literal: true

require 'avm/registry'
require 'eac_config/node'
require 'eac_ruby_utils/core_ext'

module Avm
  module Applications
    class Base
      module LocalSource
        # @return [Pathname]
        def local_source_path
          user_local_source_path || auto_local_source_path
        end

        # @return [EacConfig::Entry]
        def local_source_path_entry
          ::EacConfig::Node.context.current.entry([local_instance_id, 'install', 'path'])
        end

        # @return [Path, nil]
        def user_local_source_path
          local_source_path_entry.value.if_present(&:to_pathname)
        end

        private

        # @return [Avm::Sources::Base]
        def local_source_uncached
          ::Avm::Registry.sources.detect(local_source_path)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
avm-0.94.1 lib/avm/applications/base/local_source.rb
eac_tools-0.98.0 sub/avm/lib/avm/applications/base/local_source.rb
avm-0.94.0 lib/avm/applications/base/local_source.rb
eac_tools-0.94.0 sub/avm/lib/avm/applications/base/local_source.rb
avm-0.93.0 lib/avm/applications/base/local_source.rb
eac_tools-0.92.0 sub/avm/lib/avm/applications/base/local_source.rb
avm-0.92.0 lib/avm/applications/base/local_source.rb
eac_tools-0.91.0 sub/avm/lib/avm/applications/base/local_source.rb