Sha256: bea173ac7097664bd5e707fa8f59809047cca5163cbb186cc8db4cbd867c6953
Contents?: true
Size: 871 Bytes
Versions: 59
Compression:
Stored size: 871 Bytes
Contents
# frozen_string_literal: true require 'avm/git/launcher/error' require 'eac_ruby_utils/core_ext' require 'avm/launcher/stereotype' module Avm module Git module LauncherStereotypes class GitSubrepo require_sub __FILE__ include Avm::Launcher::Stereotype CONFIG_SUBPATH = '.gitrepo' class << self def match?(path) File.exist?(path.real.subpath(CONFIG_SUBPATH)) && subrepo_url(path.real) != 'none' end def color :light_cyan end def subrepo_url(path) File.read(path.subpath(CONFIG_SUBPATH)).each_line do |l| m = /remote\s*=\s(.+)/.match(l) return m[1] if m end raise ::Avm::Git::Launcher::Error.new(path, '"remote = ... " not found') end end end end end end
Version data entries
59 entries across 59 versions & 2 rubygems