Sha256: 748f0a3e07cd17900780d5eb96a091a9a4a96b6d9d9eba7ed5e3985efea17597

Contents?: true

Size: 800 Bytes

Versions: 100

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

module Avm
  module Git
    module Launcher
      class Base < ::Avm::Launcher::Paths::Real
        module ClassMethods
          # @return [Avm::Git::Launcher::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

100 entries across 100 versions & 2 rubygems

Version Path
avm-git-0.18.0 lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.94.0 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
avm-git-0.17.0 lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.86.5 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
avm-git-0.16.0 lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.86.4 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.86.3 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
avm-git-0.15.0 lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.86.2 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.84.0 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.83.0 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.82.0 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
avm-git-0.14.0 lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.81.0 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.80.0 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.79.0 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.78.0 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.77.1 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.77.0 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb
eac_tools-0.76.1 sub/avm-git/lib/avm/git/launcher/base/class_methods.rb