Class: 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.



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

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



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

def path
  @path
end

Instance Method Details

#uriObject



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

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