Class: HubStore::Importer

Inherits:
Object
  • Object
show all
Defined in:
lib/hub_store/importer.rb

Instance Method Summary collapse

Constructor Details

#initialize(repos:, start_date: nil) ⇒ Importer

Returns a new instance of Importer.



8
9
10
11
# File 'lib/hub_store/importer.rb', line 8

def initialize(repos:, start_date: nil)
  @repos = repos
  @start_date = start_date || 2.years.ago
end

Instance Method Details

#runObject



13
14
15
16
17
18
# File 'lib/hub_store/importer.rb', line 13

def run
  stream.in_batches do |batch|
    import_prs(batch.pull_requests)
    import_reviews(batch.reviews)
  end
end