Class: Rebuild::Repository
- Inherits:
-
Object
- Object
- Rebuild::Repository
- Defined in:
- lib/rebuild/repository.rb
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(path, options) ⇒ Repository
constructor
A new instance of Repository.
Constructor Details
#initialize(path, options) ⇒ Repository
Returns a new instance of Repository.
6 7 8 9 10 11 12 |
# File 'lib/rebuild/repository.rb', line 6 def initialize(path, ) @user, @repo = path.split('/') @directory = [:directory] @update = [:update] abort "Invalid repository `#{path}`" if @repo.nil? end |
Instance Method Details
#fetch ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/rebuild/repository.rb', line 14 def fetch if File.exists?(repo_path) sync_repository else clone_repository end repo_path end |