Sha256: d7e3e614217b44c1dbfae0deb3b9f0c931a8f3631f3e06871bb5a695a58b7530

Contents?: true

Size: 634 Bytes

Versions: 1

Compression:

Stored size: 634 Bytes

Contents

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

1 entries across 1 versions & 1 rubygems

Version Path
eac_launcher-0.6.0 lib/eac_launcher/git/sub_warp_base.rb