Sha256: 066217e3e32745a9f3d2eb323e95b2c2aa9988ab82856a4be7d09333849afe1a

Contents?: true

Size: 744 Bytes

Versions: 46

Compression:

Stored size: 744 Bytes

Contents

# frozen_string_literal: true

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

module EacLauncher
  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

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
avm-tools-0.84.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.83.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.82.1 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.82.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.81.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.80.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.79.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.78.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.77.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.76.1 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.76.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.75.1 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.75.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.74.1 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.74.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.73.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.72.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.71.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.70.2 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.70.1 lib/eac_launcher/git/sub_warp_base.rb