ghtorrent 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ = Version 0.7.3
2
+ * Support for running in standalone mode
3
+
1
4
  = Version 0.7.2
2
5
  * Support for running in standalone mode
3
6
 
@@ -431,7 +431,7 @@ module GHTorrent
431
431
  url = ghurl "repos/#{owner}/#{repo}/issues/#{issue_id}/events"
432
432
  retrieved_events = paged_api_request url
433
433
 
434
- retrieved_events.each { |x|
434
+ issue_events = retrieved_events.map { |x|
435
435
  x['owner'] = owner
436
436
  x['repo'] = repo
437
437
  x['issue_id'] = issue_id
@@ -443,9 +443,11 @@ module GHTorrent
443
443
  info "Retriever: Added issue event #{owner}/#{repo} #{issue_id}->#{x['id']}"
444
444
  persister.store(:issue_events, x)
445
445
  end
446
- }
447
- persister.find(:issue_events, {'owner' => owner, 'repo' => repo,
448
- 'issue_id' => issue_id})
446
+ x
447
+ }.map {|y| y[ext_uniq] = '0'; y}
448
+ a = persister.find(:issue_events, {'owner' => owner, 'repo' => repo,
449
+ 'issue_id' => issue_id})
450
+ if a.empty? then issue_events else a end
449
451
  end
450
452
 
451
453
  def retrieve_issue_event(owner, repo, issue_id, event_id)
@@ -466,9 +468,10 @@ module GHTorrent
466
468
  r['issue_id'] = issue_id
467
469
  persister.store(:issue_events, r)
468
470
  info "Retriever: Added issue event #{owner}/#{repo} #{issue_id}->#{event_id}"
469
- persister.find(:issue_events, {'repo' => repo, 'owner' => owner,
471
+ a = persister.find(:issue_events, {'repo' => repo, 'owner' => owner,
470
472
  'issue_id' => issue_id,
471
473
  'id' => event_id}).first
474
+ if a.nil? then r[ext_uniq] = '0'; r else a end
472
475
  else
473
476
  debug "Retriever: Issue event #{owner}/#{repo} #{issue_id}->#{event_id} exists"
474
477
  event
@@ -479,7 +482,7 @@ module GHTorrent
479
482
  url = ghurl "repos/#{owner}/#{repo}/issues/#{issue_id}/comments"
480
483
  retrieved_comments = paged_api_request url
481
484
 
482
- retrieved_comments.each { |x|
485
+ comments = retrieved_comments.each { |x|
483
486
  x['owner'] = owner
484
487
  x['repo'] = repo
485
488
  x['issue_id'] = issue_id
@@ -490,9 +493,11 @@ module GHTorrent
490
493
  'id' => x['id']}).empty?
491
494
  persister.store(:issue_comments, x)
492
495
  end
493
- }
494
- persister.find(:issue_comments, {'owner' => owner, 'repo' => repo,
495
- 'issue_id' => issue_id})
496
+ x
497
+ }.map {|y| y[ext_uniq] = '0'; y}
498
+ a = persister.find(:issue_comments, {'owner' => owner, 'repo' => repo,
499
+ 'issue_id' => issue_id})
500
+ if a.empty? then comments else a end
496
501
  end
497
502
 
498
503
  def retrieve_issue_comment(owner, repo, issue_id, comment_id)
@@ -513,10 +518,10 @@ module GHTorrent
513
518
  r['issue_id'] = issue_id
514
519
  persister.store(:issue_comments, r)
515
520
  info "Retriever: Added issue comment #{owner}/#{repo} #{issue_id}->#{comment_id}"
516
- persister.find(:issue_comments, {'repo' => repo, 'owner' => owner,
521
+ a = persister.find(:issue_comments, {'repo' => repo, 'owner' => owner,
517
522
  'issue_id' => issue_id,
518
523
  'id' => comment_id}).first
519
- r
524
+ if a.nil? then r[ext_uniq] = '0'; r else a end
520
525
  else
521
526
  debug "Retriever: Issue comment #{owner}/#{repo} #{issue_id}->#{comment_id} exists"
522
527
  comment
@@ -598,9 +603,11 @@ module GHTorrent
598
603
  end
599
604
 
600
605
  if item_id.nil?
601
- items
606
+ a = persister.find(entity, selector)
607
+ if a.empty? then items else a end
602
608
  else
603
- [items.find{|x| x[descriminator] == item_id}]
609
+ a = repo_bound_instance(entity, selector, descriminator, item_id)
610
+ if a.empty? then [items.find{|x| x[descriminator] == item_id}] else a end
604
611
  end
605
612
  end
606
613
 
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module GHTorrent
2
2
 
3
- VERSION = '0.7.2'
3
+ VERSION = '0.7.3'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghtorrent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -180,7 +180,7 @@ files:
180
180
  homepage: https://github.com/gousiosg/github-mirror
181
181
  licenses: []
182
182
  post_install_message: !binary |-
183
- WxtbMzJtVmVyc2lvbiAwLjcuMhtbMG1dIFN1cHBvcnQgZm9yIHJ1bm5pbmcg
183
+ WxtbMzJtVmVyc2lvbiAwLjcuMxtbMG1dIFN1cHBvcnQgZm9yIHJ1bm5pbmcg
184
184
  aW4gc3RhbmRhbG9uZSBtb2RlCg==
185
185
  rdoc_options:
186
186
  - --charset=UTF-8