Sha256: ab2a38ab16abc83dea7db6812437476d00c291838a8e4ba215f2a4f3e0dda42a

Contents?: true

Size: 798 Bytes

Versions: 109

Compression:

Stored size: 798 Bytes

Contents

# frozen_string_literal: true

require 'avm/projects/stereotype'
require 'avm/launcher/errors/base'

module Avm
  module Launcher
    module Git
      module SubWarpBase
        private

        def parent_instance_uncached
          r = find_parent_instance(instance.parent)
          return r if r

          ::Avm::Launcher::Errors::Base.new('Git parent not found')
        end

        def find_parent_instance(current)
          if ::Avm::Projects::Stereotype.git_stereotypes.any? { |s| current.stereotype?(s) }
            return current
          end

          current.parent ? find_parent_instance(current.parent) : nil
        end

        def to_parent_git_path
          instance.logical.gsub(%r{\A#{Regexp.quote(parent_instance.logical)}/}, '')
        end
      end
    end
  end
end

Version data entries

109 entries across 109 versions & 2 rubygems

Version Path
avm-tools-0.140.0 lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.36.0 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
avm-tools-0.139.0 lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.35.0 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
avm-tools-0.138.0 lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.34.0 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
avm-tools-0.137.0 lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.33.0 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.32.0 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
avm-tools-0.136.2 lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.31.1 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.31.0 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
avm-tools-0.136.1 lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.30.0 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.29.0 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
avm-tools-0.136.0 lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.28.0 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.27.2 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
eac_tools-0.27.1 sub/avm-tools/lib/avm/launcher/git/sub_warp_base.rb
avm-tools-0.135.0 lib/avm/launcher/git/sub_warp_base.rb