Class: Forte::RepoLocation

Inherits:
Object
  • Object
show all
Defined in:
lib/forte/repo_location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ RepoLocation

Returns a new instance of RepoLocation.



5
6
7
# File 'lib/forte/repo_location.rb', line 5

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/forte/repo_location.rb', line 3

def path
  @path
end

Instance Method Details

#uriObject



9
10
11
12
13
14
# File 'lib/forte/repo_location.rb', line 9

def uri
  return path if path.start_with?('git@')
  return path if path.start_with?('http')
  return path if Dir.exists?(File.join(path, '.git'))
  "https://github.com/#{path}.git"
end