Class: Forte::RepoLocation
- Inherits:
-
Object
- Object
- Forte::RepoLocation
- Defined in:
- lib/forte/repo_location.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ RepoLocation
constructor
A new instance of RepoLocation.
- #uri ⇒ Object
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
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/forte/repo_location.rb', line 3 def path @path end |
Instance Method Details
#uri ⇒ Object
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 |