Class: Rebuild::Repository
- Inherits:
-
Object
- Object
- Rebuild::Repository
- Defined in:
- lib/rebuild/repository.rb
Constant Summary collapse
- DEFAULT_DIRECTORY =
'/tmp'
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.
8 9 10 11 12 13 14 |
# File 'lib/rebuild/repository.rb', line 8 def initialize(path, ) @user, @repo = path.split('/') @directory = [:directory] @update = [:update] abort "Invalid repository `#{path}`" if @repo.nil? end |
Instance Method Details
#fetch ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/rebuild/repository.rb', line 16 def fetch if File.exists?(repo_path) sync_repository else clone_repository end repo_path end |