Class: Integrity::SCM::Git::URI

Inherits:
Object
  • Object
show all
Defined in:
lib/integrity/scm/git/uri.rb

Overview

From the git-pull man page:

GIT URLS

One of the following notations can be used to name the remote repository:

  rsync://host.xz/path/to/repo.git/
  http://host.xz/path/to/repo.git/
  git://host.xz/~user/path/to/repo.git/
  ssh://[user@]host.xz[:port]/path/to/repo.git/
  ssh://[user@]host.xz/path/to/repo.git/
  ssh://[user@]host.xz/~user/path/to/repo.git/
  ssh://[user@]host.xz/~/path/to/repo.git

SSH is the default transport protocol over the network. You can optionally 
specify which user to log-in as, and an alternate, scp-like syntax is also 
supported

Both syntaxes support username expansion, as does the native git protocol, 
but only the former supports port specification. The following three are 
identical to the last three above, respectively:

  [user@]host.xz:/path/to/repo.git/
  [user@]host.xz:~user/path/to/repo.git/
  [user@]host.xz:path/to/repo.git

Instance Method Summary collapse

Constructor Details

#initialize(uri_string) ⇒ URI

Returns a new instance of URI.



30
31
32
# File 'lib/integrity/scm/git/uri.rb', line 30

def initialize(uri_string)
  @uri = Addressable::URI.parse(uri_string)
end

Instance Method Details

#working_tree_pathObject



34
35
36
# File 'lib/integrity/scm/git/uri.rb', line 34

def working_tree_path
  strip_extension(path).gsub("/", "-")
end