Sha256: f816ef1fc79b5443f540872c5a6c999d2577b0562ec72ce6431b21a625823eac

Contents?: true

Size: 753 Bytes

Versions: 10

Compression:

Stored size: 753 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

        ::EacLauncher::Instances::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

10 entries across 10 versions & 1 rubygems

Version Path
avm-tools-0.67.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.66.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.65.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.64.2 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.64.1 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.64.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.63.0 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.62.4 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.62.3 lib/eac_launcher/git/sub_warp_base.rb
avm-tools-0.62.2 lib/eac_launcher/git/sub_warp_base.rb