Sha256: a5beb30e3b9fa453a4c9194e03a6489ab7c7df28b5b6b8b589e95ab2e94d37f9
Contents?: true
Size: 800 Bytes
Versions: 109
Compression:
Stored size: 800 Bytes
Contents
# frozen_string_literal: true module Avm module Launcher module Git class Base < ::Avm::Launcher::Paths::Real module ClassMethods # @return [Avm::Launcher::Git::Base] def by_root(search_base_path) new(find_root(search_base_path).to_path) end # Searches the root path for the Git repository which includes +search_base_path+. # @return [Pathname] def find_root(search_base_path) path = search_base_path.to_pathname.expand_path loop do return path if path.join('.git').exist? raise "\".git\" not found for \"#{search_base_path}\"" if path.parent.root? path = path.parent end end end end end end end
Version data entries
109 entries across 109 versions & 2 rubygems