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.13.0 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.55.4 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.55.3 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.55.2 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.55.1 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.55.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
avm-git-0.12.0 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.54.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.53.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.52.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.51.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
avm-git-0.11.0 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.50.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.49.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.48.1 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.48.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.47.2 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.47.1 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb
avm-git-0.10.1 lib/avm/git/launcher/sub_warp_base.rb
eac_tools-0.47.0 sub/avm-git/lib/avm/git/launcher/sub_warp_base.rb