Sha256: c2da9ce09dd080d2a321b7d6f5ace1cc24bdcb6aeb9330f44bbbe98f56c7b462

Contents?: true

Size: 1.25 KB

Versions: 85

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

require 'avm/registry'
require 'avm/scms/null'
require 'avm/with/application_stereotype'
require 'avm/with/extra_subcommands'
require 'eac_git'
require 'eac_ruby_utils/core_ext'

module Avm
  module Sources
    class Base
      require_sub __FILE__, include_modules: true
      include ::Avm::With::ApplicationStereotype
      include ::Avm::With::ExtraSubcommands
      compare_by :path
      enable_abstract_methods
      enable_simple_cache
      enable_listable
      lists.add_symbol :option, :parent
      common_constructor :path, :options, default: [{}] do
        self.path = path.to_pathname.expand_path
        self.options = ::Avm::Sources::Base.lists.option.hash_keys_validate!(options)
      end

      abstract_methods :valid?

      # @return [EacRubyUtils::Envs::LocalEnv]
      def env
        ::EacRubyUtils::Envs::LocalEnv.new
      end

      # @return [Pathname]
      def relative_path
        return path if parent.blank?

        path.relative_path_from(parent.path)
      end

      def to_s
        "#{self.class}[#{path}]"
      end

      private

      # @return [Avm::Scms::Base]
      def scm_uncached
        ::Avm::Registry.scms.detect_optional(path) || ::Avm::Scms::Null.new(path)
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 2 rubygems

Version Path
eac_tools-0.60.1 sub/avm/lib/avm/sources/base.rb
eac_tools-0.60.0 sub/avm/lib/avm/sources/base.rb
eac_tools-0.59.0 sub/avm/lib/avm/sources/base.rb
avm-0.66.1 lib/avm/sources/base.rb
eac_tools-0.58.0 sub/avm/lib/avm/sources/base.rb
eac_tools-0.57.0 sub/avm/lib/avm/sources/base.rb
eac_tools-0.56.1 sub/avm/lib/avm/sources/base.rb
avm-0.66.0 lib/avm/sources/base.rb
eac_tools-0.56.0 sub/avm/lib/avm/sources/base.rb
avm-0.65.0 lib/avm/sources/base.rb
eac_tools-0.55.7 sub/avm/lib/avm/sources/base.rb
avm-0.64.2 lib/avm/sources/base.rb
eac_tools-0.55.6 sub/avm/lib/avm/sources/base.rb
avm-0.64.1 lib/avm/sources/base.rb
eac_tools-0.55.5 sub/avm/lib/avm/sources/base.rb
avm-0.64.0 lib/avm/sources/base.rb
eac_tools-0.55.4 sub/avm/lib/avm/sources/base.rb
avm-0.63.0 lib/avm/sources/base.rb
eac_tools-0.55.3 sub/avm/lib/avm/sources/base.rb
eac_tools-0.55.2 sub/avm/lib/avm/sources/base.rb