Sha256: 7339ad6aa505e0b6e6fd8e889cce929502b730962e163049923fba1b245248b7

Contents?: true

Size: 1.19 KB

Versions: 82

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

require 'avm/with/application_stereotype'
require 'eac_ruby_utils/core_ext'

module Avm
  module Scms
    class Base
      require_sub __FILE__, include_modules: true
      enable_abstract_methods
      enable_simple_cache
      include ::Avm::With::ApplicationStereotype
      abstract_methods :update, :valid?
      common_constructor :path do
        self.path = path.to_pathname
      end

      # @return [Avm::Scms::ChangedFile]
      def changed_files
        raise_abstract_method __method__
      end

      # @return [Avm::Scms::Interval]
      def interval(_from, _to)
        raise_abstract_method __method__
      end

      def name
        self.class.name.demodulize
      end

      # @return [Pathname]
      def relative_path_from_parent_scm
        parent_scm.if_present(nil) do |v|
          path.relative_path_from(v.path)
        end
      end

      # @return [Enumerable<Avm::Scms::Base>]
      def subs
        raise_abstract_method __method__
      end

      def to_s
        name
      end

      private

      # @return [Avm::Scms::Base]
      def parent_scm_uncached
        ::Avm::Registry.scms.detect_by_path_optional(path.parent)
      end
    end
  end
end

Version data entries

82 entries across 82 versions & 2 rubygems

Version Path
eac_tools-0.86.3 sub/avm/lib/avm/scms/base.rb
avm-0.85.0 lib/avm/scms/base.rb
eac_tools-0.86.2 sub/avm/lib/avm/scms/base.rb
avm-0.84.3 lib/avm/scms/base.rb
eac_tools-0.86.1 sub/avm/lib/avm/scms/base.rb
eac_tools-0.84.2 sub/avm/lib/avm/scms/base.rb
avm-0.84.2 lib/avm/scms/base.rb
eac_tools-0.84.1 sub/avm/lib/avm/scms/base.rb
avm-0.84.1 lib/avm/scms/base.rb
eac_tools-0.84.0 sub/avm/lib/avm/scms/base.rb
avm-0.84.0 lib/avm/scms/base.rb
eac_tools-0.83.0 sub/avm/lib/avm/scms/base.rb
avm-0.83.0 lib/avm/scms/base.rb
eac_tools-0.82.0 sub/avm/lib/avm/scms/base.rb
avm-0.82.0 lib/avm/scms/base.rb
eac_tools-0.81.0 sub/avm/lib/avm/scms/base.rb
eac_tools-0.80.0 sub/avm/lib/avm/scms/base.rb
avm-0.81.0 lib/avm/scms/base.rb
eac_tools-0.79.0 sub/avm/lib/avm/scms/base.rb
avm-0.80.0 lib/avm/scms/base.rb