Class: Rebuild::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/rebuild/repository.rb

Instance Method Summary collapse

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, options)
  @user, @repo = path.split('/')
  @directory   = options[:directory]
  @update      = options[:update]

  abort "Invalid repository `#{path}`" if @repo.nil?
end

Instance Method Details

#fetchObject



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