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
avm-git-0.18.0 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.94.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
avm-git-0.17.0 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.86.5 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
avm-git-0.16.0 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.86.4 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.86.3 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
avm-git-0.15.0 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.86.2 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.84.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.83.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.82.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
avm-git-0.14.0 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.81.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.80.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.79.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.78.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.77.1 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.77.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.76.1 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb