Class: Bugwatch::Import

Inherits:
Object
  • Object
show all
Defined in:
lib/bugwatch/import.rb

Instance Method Summary collapse

Constructor Details

#initialize(repo, caching_strategy) ⇒ Import

Returns a new instance of Import.



35
36
37
38
# File 'lib/bugwatch/import.rb', line 35

def initialize(repo, caching_strategy)
  @repo = repo
  @caching_strategy = caching_strategy
end

Instance Method Details

#import(begin_sha = nil) ⇒ Object



40
41
42
43
44
45
# File 'lib/bugwatch/import.rb', line 40

def import(begin_sha=nil)
  unimported_commits(begin_sha).each do |commit_sha|
    commit = @repo.commit(commit_sha)
    @caching_strategy.store(commit) if commit
  end
end