Class: RepoLocation
- Inherits:
-
Object
- Object
- 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.
4 5 6 |
# File 'lib/forte/repo_location.rb', line 4 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
2 3 4 |
# File 'lib/forte/repo_location.rb', line 2 def path @path end |
Instance Method Details
#uri ⇒ Object
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 |