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

Version Path
avm-tools-0.99.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.98.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.97.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.96.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.95.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.94.3 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.94.2 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.94.1 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.94.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.93.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.92.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.91.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.90.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.89.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.88.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.87.1 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.87.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.86.0 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.85.1 lib/eac_launcher/git/base/class_methods.rb
avm-tools-0.85.0 lib/eac_launcher/git/base/class_methods.rb