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

Version Path
avm-tools-0.140.0 lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.36.0 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
avm-tools-0.139.0 lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.35.0 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
avm-tools-0.138.0 lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.34.0 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
avm-tools-0.137.0 lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.33.0 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.32.0 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
avm-tools-0.136.2 lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.31.1 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.31.0 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
avm-tools-0.136.1 lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.30.0 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.29.0 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
avm-tools-0.136.0 lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.28.0 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.27.2 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
eac_tools-0.27.1 sub/avm-tools/lib/avm/launcher/git/base/class_methods.rb
avm-tools-0.135.0 lib/avm/launcher/git/base/class_methods.rb