Sha256: f9426fccb9222f0cd72c8b9a95268c302eaff37c2f54cbc9ceb02dbda2faa167

Contents?: true

Size: 798 Bytes

Versions: 100

Compression:

Stored size: 798 Bytes

Contents

# frozen_string_literal: true

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

module Avm
  module Git
    module Launcher
      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::Launcher::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

100 entries across 100 versions & 2 rubygems

Version Path
eac_tools-0.64.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.63.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.62.1 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.62.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
avm-git-0.13.2 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.61.1 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.61.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.60.3 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.60.2 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.60.1 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.60.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.59.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.58.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.57.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.56.1 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.56.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.55.7 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
avm-git-0.13.1 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.55.6 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.55.5 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb