Sha256: de58e514a4bc8d9ae2520b7f67e622d0956f447dcf922dd1aa7633fe03d5a1a0
Contents?: true
Size: 740 Bytes
Versions: 75
Compression:
Stored size: 740 Bytes
Contents
# frozen_string_literal: true module EacLauncher module Git class Base < ::EacLauncher::Paths::Real module ClassMethods # @return [EacLauncher::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
Version data entries
75 entries across 75 versions & 1 rubygems