Sha256: 4da7c27e00ef32d2887c62a7d09b609f6179e94534f1e818cd2bda3189977695
Contents?: true
Size: 1.31 KB
Versions: 170
Compression:
Stored size: 1.31 KB
Contents
# frozen_string_literal: true require 'avm/projects/stereotype' require 'avm/projects/stereotypes/git' require 'eac_ruby_utils/core_ext' module Avm module Projects module Stereotypes class GitSubtree require_sub __FILE__ include Avm::Projects::Stereotype class << self def match?(path) return false if other_git_stereotype?(path) return false unless other_nogit_stereotype?(path) parent = parent_git(path.parent_path) return false unless parent ::Git.open(parent.real).remote(path.real.basename).url ? true : false end def color :green end def parent_git(parent_path) return nil unless parent_path if ::Avm::Projects::Stereotypes::Git.match?(parent_path) parent_path else parent_git(parent_path.parent_path) end end def other_git_stereotype?(path) ::Avm::Projects::Stereotypes::Git.match?(path) || ::Avm::Projects::Stereotypes::GitSubrepo.match?(path) end def other_nogit_stereotype?(path) Avm::Projects::Stereotype.nogit_stereotypes.any? { |s| s.match?(path) } end end end end end end
Version data entries
170 entries across 170 versions & 2 rubygems