Sha256: 20e3f099caec2ef9ea2cd20c6af5dd8b0f114ae987cecd30aa567e4101ad7e1b

Contents?: true

Size: 667 Bytes

Versions: 4

Compression:

Stored size: 667 Bytes

Contents

# frozen_string_literal: true

require 'eac_launcher/instances/error'

module EacLauncher
  module Git
    module SubWarpBase
      private

      def parent_instance_uncached
        r = find_parent_instance(instance.parent)
        return r if r

        ::EacLauncher::Instances::Error.new('Git parent not found')
      end

      def find_parent_instance(current)
        return current if current.stereotype?(::EacLauncher::Stereotypes::Git)

        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

4 entries across 4 versions & 1 rubygems

Version Path
eac_launcher-0.6.4 lib/eac_launcher/git/sub_warp_base.rb
eac_launcher-0.6.3 lib/eac_launcher/git/sub_warp_base.rb
eac_launcher-0.6.2 lib/eac_launcher/git/sub_warp_base.rb
eac_launcher-0.6.1 lib/eac_launcher/git/sub_warp_base.rb