Module: GHTorrent::Retriever

Constant Summary

Constants included from Settings

Settings::CONFIGKEYS, Settings::DEFAULTS

Instance Method Summary collapse

Methods included from Logging

#debug, #error, #info, #loggerr, #warn

Methods included from Settings

#config, #merge, #merge_config_values, #override_config, #settings

Methods included from Utils

included, #read_value, #user_type, #write_value

Methods included from APIClient

#api_request, #num_pages, #paged_api_request

Instance Method Details

#get_event(id) ⇒ Object

Get a specific event by id.



576
577
578
# File 'lib/ghtorrent/retriever.rb', line 576

def get_event(id)
  persister.find(:events, {'id' => id})
end

#get_eventsObject

Get current Github events



552
553
554
# File 'lib/ghtorrent/retriever.rb', line 552

def get_events
  api_request "https://api.github.com/events"
end

#get_repo_events(owner, repo) ⇒ Object

Get all events for the specified repo. GitHub will only return 90 days of events



558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/ghtorrent/retriever.rb', line 558

def get_repo_events(owner, repo)
  url = ghurl("repos/#{owner}/#{repo}/events")
  r = paged_api_request(url)

  r.each do |e|
    unless get_event(e['id']).empty?
      debug "Repository event #{owner}/#{repo} -> #{e['type']}-#{e['id']} already exists"
    else
      persister.store(:events, e)
      info "Added event for repository #{owner}/#{repo} -> #{e['type']}-#{e['id']}"
    end
  end

  persister.find(:events, {'repo.name' => "#{owner}/#{repo}"})

end

#persisterObject

Raises:

  • (Exception)


17
18
19
# File 'lib/ghtorrent/retriever.rb', line 17

def persister
  raise Exception.new("Unimplemented")
end

#retrieve_commit(repo, sha, user) ⇒ Object

Retrieve a single commit from a repo



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/ghtorrent/retriever.rb', line 157

def retrieve_commit(repo, sha, user)
  commit = persister.find(:commits, {'sha' => "#{sha}"})

  if commit.empty?
    url = ghurl "repos/#{user}/#{repo}/commits/#{sha}"
    c = api_request(url)

    if c.empty?
      return
    end

    unq = persister.store(:commits, c)
    info "Added commit #{user}/#{repo} -> #{sha}"
    c
  else
    debug "Commit #{user}/#{repo} -> #{sha} exists"
    commit.first
  end
end

#retrieve_commit_comment(owner, repo, sha, id) ⇒ Object

Retrieve a single comment



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/ghtorrent/retriever.rb', line 266

def retrieve_commit_comment(owner, repo, sha, id)

  comment = persister.find(:commit_comments, {'commit_id' => sha,
                                              'id' => id}).first
  if comment.nil?
    r = api_request(ghurl "repos/#{owner}/#{repo}/comments/#{id}")

    if r.empty?
      warn "Could not find commit_comment #{id}. Deleted?"
      return
    end

    persister.store(:commit_comments, r)
    info "Added commit_comment #{r['commit_id']} -> #{r['id']}"
    persister.find(:commit_comments, {'commit_id' => sha, 'id' => id}).first
  else
    debug "Commit comment #{comment['commit_id']} -> #{comment['id']} exists"
    comment
  end
end

#retrieve_commit_comments(owner, repo, sha) ⇒ Object

Retrieve all comments for a single commit



253
254
255
256
257
258
259
260
261
262
263
# File 'lib/ghtorrent/retriever.rb', line 253

def retrieve_commit_comments(owner, repo, sha)
  retrieved_comments = paged_api_request(ghurl "repos/#{owner}/#{repo}/commits/#{sha}/comments")

  retrieved_comments.each { |x|
    if persister.find(:commit_comments, { 'commit_id' => x['commit_id'],
                                          'id' => x['id']}).empty?
      persister.store(:commit_comments, x)
    end
  }
  persister.find(:commit_comments, {'commit_id' => sha})
end

#retrieve_commits(repo, sha, user, pages = -1)) ⇒ Object

Retrieve commits starting from the provided sha



178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/ghtorrent/retriever.rb', line 178

def retrieve_commits(repo, sha, user, pages = -1)

  url = if sha.nil?
          ghurl "repos/#{user}/#{repo}/commits"
        else
          ghurl "repos/#{user}/#{repo}/commits?sha=#{sha}"
        end

  commits = restricted_page_request(url, pages)

  commits.map do |c|
    retrieve_commit(repo, c['sha'], user)
  end
end

#retrieve_fork(user, repo, fork_id) ⇒ Object



345
346
347
348
349
350
# File 'lib/ghtorrent/retriever.rb', line 345

def retrieve_fork(user, repo, fork_id)
  repo_bound_item(user, repo, fork_id, :forks,
                   ["repos/#{user}/#{repo}/forks"],
                   {'repo' => repo, 'owner' => user},
                   'id')
end

#retrieve_forks(user, repo) ⇒ Object



338
339
340
341
342
343
# File 'lib/ghtorrent/retriever.rb', line 338

def retrieve_forks(user, repo)
  repo_bound_items(user, repo, :forks,
                   ["repos/#{user}/#{repo}/forks"],
                   {'repo' => repo, 'owner' => user},
                   'id', item = nil, refresh = false, order = :asc)
end

#retrieve_issue(user, repo, issue_id) ⇒ Object



422
423
424
425
426
427
428
429
# File 'lib/ghtorrent/retriever.rb', line 422

def retrieve_issue(user, repo, issue_id)
  open = "repos/#{user}/#{repo}/issues"
  closed = "repos/#{user}/#{repo}/issues?state=closed"
  repo_bound_item(user, repo, issue_id, :issues,
                  [open, closed],
                  {'repo' => repo, 'owner' => user},
                  'number')
end

#retrieve_issue_comment(owner, repo, issue_id, comment_id) ⇒ Object



504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
# File 'lib/ghtorrent/retriever.rb', line 504

def retrieve_issue_comment(owner, repo, issue_id, comment_id)
  comment = persister.find(:issue_comments, {'repo' => repo,
                                             'owner' => owner,
                                             'issue_id' => issue_id,
                                             'id' => comment_id}).first
  if comment.nil?
    r = api_request(ghurl "repos/#{owner}/#{repo}/issues/comments/#{comment_id}")

    if r.empty?
      warn "Could not find issue_comment #{owner}/#{repo} #{issue_id}->#{comment_id}. Deleted?"
      return
    end

    r['repo'] = repo
    r['owner'] = owner
    r['issue_id'] = issue_id
    persister.store(:issue_comments, r)
    info "Added issue_comment #{owner}/#{repo} #{issue_id}->#{comment_id}"
    a = persister.find(:issue_comments, {'repo' => repo, 'owner' => owner,
                                     'issue_id' => issue_id,
                                     'id' => comment_id}).first
    if a.nil? then r else a end
  else
    debug "Issue comment #{owner}/#{repo} #{issue_id}->#{comment_id} exists"
    comment
  end
end

#retrieve_issue_comments(owner, repo, issue_id) ⇒ Object



482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/ghtorrent/retriever.rb', line 482

def retrieve_issue_comments(owner, repo, issue_id)
  url = ghurl "repos/#{owner}/#{repo}/issues/#{issue_id}/comments"
  retrieved_comments = paged_api_request url

  comments = retrieved_comments.each { |x|
    x['owner'] = owner
    x['repo'] = repo
    x['issue_id'] = issue_id

    if persister.find(:issue_comments, {'owner' => owner,
                                        'repo' => repo,
                                        'issue_id' => issue_id,
                                        'id' => x['id']}).empty?
      persister.store(:issue_comments, x)
    end
    x
  }
  a = persister.find(:issue_comments, {'owner' => owner, 'repo' => repo,
                                       'issue_id' => issue_id})
  if a.empty? then comments else a end
end

#retrieve_issue_event(owner, repo, issue_id, event_id) ⇒ Object



454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# File 'lib/ghtorrent/retriever.rb', line 454

def retrieve_issue_event(owner, repo, issue_id, event_id)
  event = persister.find(:issue_events, {'repo' => repo,
                                         'owner' => owner,
                                         'issue_id' => issue_id,
                                         'id' => event_id}).first
  if event.nil?
    r = api_request(ghurl "repos/#{owner}/#{repo}/issues/events/#{event_id}")

    if r.empty?
      warn "Could not find issue_event #{owner}/#{repo} #{issue_id}->#{event_id}. Deleted?"
      return
    end

    r['repo'] = repo
    r['owner'] = owner
    r['issue_id'] = issue_id
    persister.store(:issue_events, r)
    info "Added issue_event #{owner}/#{repo} #{issue_id}->#{event_id}"
    a = persister.find(:issue_events, {'repo' => repo, 'owner' => owner,
                                   'issue_id' => issue_id,
                                   'id' => event_id}).first
    if a.nil? then r else a end
  else
    debug "Issue event #{owner}/#{repo} #{issue_id}->#{event_id} exists"
    event
  end
end

#retrieve_issue_events(owner, repo, issue_id) ⇒ Object



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/ghtorrent/retriever.rb', line 431

def retrieve_issue_events(owner, repo, issue_id)
  url = ghurl "repos/#{owner}/#{repo}/issues/#{issue_id}/events"
  retrieved_events = paged_api_request url

  issue_events = retrieved_events.map { |x|
    x['owner'] = owner
    x['repo'] = repo
    x['issue_id'] = issue_id

    if persister.find(:issue_events, {'owner' => owner,
                                      'repo' => repo,
                                      'issue_id' => issue_id,
                                      'id' => x['id']}).empty?
      info "Added issue_event #{owner}/#{repo} #{issue_id}->#{x['id']}"
      persister.store(:issue_events, x)
    end
    x
  }
  a = persister.find(:issue_events, {'owner' => owner, 'repo' => repo,
                                     'issue_id' => issue_id})
  if a.empty? then issue_events else a end
end

#retrieve_issue_labels(owner, repo, issue_id) ⇒ Object



546
547
548
549
# File 'lib/ghtorrent/retriever.rb', line 546

def retrieve_issue_labels(owner, repo, issue_id)
  url = ghurl("repos/#{owner}/#{repo}/issues/#{issue_id}/labels")
  paged_api_request(url)
end

#retrieve_issues(user, repo, refr = false) ⇒ Object



413
414
415
416
417
418
419
420
# File 'lib/ghtorrent/retriever.rb', line 413

def retrieve_issues(user, repo, refr = false)
  open = "repos/#{user}/#{repo}/issues"
  closed = "repos/#{user}/#{repo}/issues?state=closed"
  repo_bound_items(user, repo, :issues,
                   [open, closed],
                   {'repo' => repo, 'owner' => user},
                   'number', item = nil, refresh = refr, order = :asc)
end

#retrieve_languages(owner, repo) ⇒ Object



213
214
215
# File 'lib/ghtorrent/retriever.rb', line 213

def retrieve_languages(owner, repo)
  paged_api_request ghurl "repos/#{owner}/#{repo}/languages"
end

#retrieve_org(org) ⇒ Object

Retrieve a single organization



225
226
227
# File 'lib/ghtorrent/retriever.rb', line 225

def retrieve_org(org)
  retrieve_user_byusername(org)
end

#retrieve_org_members(org) ⇒ Object

Retrieve organization members



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/ghtorrent/retriever.rb', line 230

def retrieve_org_members(org)
  stored_org_members = persister.find(:org_members, {'org' => org})

  org_members = paged_api_request(ghurl "orgs/#{org}/members")
  org_members.each do |x|
    x['org'] = org

    exists = !stored_org_members.find { |f|
      f['org'] == org && f['login'] == x['login']
    }.nil?

    if not exists
      persister.store(:org_members, x)
      info "Added org_member #{org} -> #{x['login']}"
    else
      debug "Org Member #{org} -> #{x['login']} exists"
    end
  end

  persister.find(:org_members, {'org' => org}).map{|o| retrieve_org(o['login'])}
end

#retrieve_orgs(user) ⇒ Object

Retrieve organizations the provided user participates into



218
219
220
221
222
# File 'lib/ghtorrent/retriever.rb', line 218

def retrieve_orgs(user)
  url = ghurl "users/#{user}/orgs"
  orgs = paged_api_request(url)
  orgs.map{|o| retrieve_org(o['login'])}
end

#retrieve_pull_req_comment(owner, repo, pullreq_id, comment_id) ⇒ Object



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/ghtorrent/retriever.rb', line 386

def retrieve_pull_req_comment(owner, repo, pullreq_id, comment_id)
  comment = persister.find(:pull_request_comments, {'repo' => repo,
                                             'owner' => owner,
                                             'pullreq_id' => pullreq_id.to_i,
                                             'id' => comment_id}).first
  if comment.nil?
    r = api_request(ghurl "repos/#{owner}/#{repo}/pulls/comments/#{comment_id}")

    if r.empty?
      warn "Could not find pullreq_comment #{owner}/#{repo} #{pullreq_id}->#{comment_id}. Deleted?"
      return
    end

    r['repo'] = repo
    r['owner'] = owner
    r['pullreq_id'] = pullreq_id.to_i
    persister.store(:pull_request_comments, r)
    info "Added pullreq_comment #{owner}/#{repo} #{pullreq_id}->#{comment_id}"
    persister.find(:pull_request_comments, {'repo' => repo, 'owner' => owner,
                                     'pullreq_id' => pullreq_id.to_i,
                                     'id' => comment_id}).first
  else
    debug "Pull request comment #{owner}/#{repo} #{pullreq_id}->#{comment_id} exists"
    comment
  end
end

#retrieve_pull_req_comments(owner, repo, pullreq_id) ⇒ Object



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/ghtorrent/retriever.rb', line 363

def retrieve_pull_req_comments(owner, repo, pullreq_id)
  review_comments_url = ghurl "repos/#{owner}/#{repo}/pulls/#{pullreq_id}/comments"

  url = review_comments_url
  retrieved_comments = paged_api_request url

  retrieved_comments.each do |x|
    x['owner'] = owner
    x['repo'] = repo
    x['pullreq_id'] = pullreq_id.to_i

    if persister.find(:pull_request_comments, {'owner' => owner,
                                               'repo' => repo,
                                               'pullreq_id' => pullreq_id,
                                               'id' => x['id']}).empty?
      persister.store(:pull_request_comments, x)
    end
  end

  persister.find(:pull_request_comments, {'owner' => owner, 'repo' => repo,
                                          'pullreq_id' => pullreq_id})
end

#retrieve_pull_req_commits(user, repo, pullreq_id) ⇒ Object



352
353
354
355
356
357
358
359
360
361
# File 'lib/ghtorrent/retriever.rb', line 352

def retrieve_pull_req_commits(user, repo, pullreq_id)
  pr_commits = paged_api_request(ghurl "repos/#{user}/#{repo}/pulls/#{pullreq_id}/commits")

  pr_commits.map do |x|
    head_user = x['url'].split(/\//)[4]
    head_repo = x['url'].split(/\//)[5]

    retrieve_commit(head_repo, x['sha'], head_user)
  end.select{|x| not x.nil?}
end

#retrieve_pull_request(user, repo, pullreq_id) ⇒ Object



328
329
330
331
332
333
334
335
336
# File 'lib/ghtorrent/retriever.rb', line 328

def retrieve_pull_request(user, repo, pullreq_id)
  open = "repos/#{user}/#{repo}/pulls"
  closed = "repos/#{user}/#{repo}/pulls?state=closed"
  repo_bound_item(user, repo, pullreq_id, :pull_requests,
                  [open, closed],
                  {'repo' => repo, 'owner' => user,
                   'number' => pullreq_id},
                  'number')
end

#retrieve_pull_requests(user, repo, refr = false) ⇒ Object



319
320
321
322
323
324
325
326
# File 'lib/ghtorrent/retriever.rb', line 319

def retrieve_pull_requests(user, repo, refr = false)
  open = "repos/#{user}/#{repo}/pulls"
  closed = "repos/#{user}/#{repo}/pulls?state=closed"
  repo_bound_items(user, repo, :pull_requests,
                   [open, closed],
                   {'repo' => repo, 'owner' => user},
                   'number', item = nil, refresh = refr, order = :asc)
end

#retrieve_repo(user, repo) ⇒ Object



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/ghtorrent/retriever.rb', line 193

def retrieve_repo(user, repo)
  stored_repo = persister.find(:repos, {'owner.login' => user,
                                         'name' => repo })
  if stored_repo.empty?
    url = ghurl "repos/#{user}/#{repo}"
    r = api_request(url)

    if r.empty?
      return
    end

    unq = persister.store(:repos, r)
    info "Added repo #{user} -> #{repo}"
    r
  else
    debug "Repo #{user} -> #{repo} exists"
    stored_repo.first
  end
end

#retrieve_repo_collaborator(user, repo, new_member) ⇒ Object

Retrieve a single repository collaborator



296
297
298
299
300
301
# File 'lib/ghtorrent/retriever.rb', line 296

def retrieve_repo_collaborator(user, repo, new_member)
  repo_bound_item(user, repo, new_member, :repo_collaborators,
                  ["repos/#{user}/#{repo}/collaborators"],
                  {'repo' => repo, 'owner' => user},
                  'login')
end

#retrieve_repo_collaborators(user, repo) ⇒ Object

Retrieve all collaborators for a repository



288
289
290
291
292
293
# File 'lib/ghtorrent/retriever.rb', line 288

def retrieve_repo_collaborators(user, repo)
  repo_bound_items(user, repo, :repo_collaborators,
                   ["repos/#{user}/#{repo}/collaborators"],
                   {'repo' => repo, 'owner' => user},
                   'login', item = nil, refresh = false, order = :asc)
end

#retrieve_repo_label(owner, repo, name) ⇒ Object



539
540
541
542
543
544
# File 'lib/ghtorrent/retriever.rb', line 539

def retrieve_repo_label(owner, repo, name)
  repo_bound_item(owner, repo, name, :repo_labels,
                   ["repos/#{owner}/#{repo}/labels"],
                   {'repo' => repo, 'owner' => owner},
                   'name')
end

#retrieve_repo_labels(owner, repo, refr = false) ⇒ Object



532
533
534
535
536
537
# File 'lib/ghtorrent/retriever.rb', line 532

def retrieve_repo_labels(owner, repo, refr = false)
  repo_bound_items(owner, repo, :repo_labels,
                   ["repos/#{owner}/#{repo}/labels"],
                   {'repo' => repo, 'owner' => owner},
                   'name', item = nil, refresh = refr, order = :asc)
end

#retrieve_user_byemail(email, name) ⇒ Object

Try Github user search by email. This is optional info, so it may not return any data. If this fails, try searching by name developer.github.com/v3/search/#email-search



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/ghtorrent/retriever.rb', line 45

def retrieve_user_byemail(email, name)
  url = ghurl("legacy/user/email/#{CGI.escape(email)}")
  byemail = api_request(url)

  if byemail.empty?
    # Only search by name if name param looks like a proper name
    byname = if not name.nil? and name.split(/ /).size > 1
              url = ghurl("legacy/user/search/#{CGI.escape(name)}")
              api_request(url)
             end

    if byname.nil? or byname['users'].nil? or byname['users'].empty?
      nil
    else
      user = byname['users'].find do |u|
            u['name'] == name and
            not u['login'].nil? and
            not retrieve_user_byusername(u['login']).nil?
      end

      unless user.nil?
        # Make extra sure that if we got an email it matches that
        # of the retrieved user
        if not email.nil? and user['email'] == email
          user
        else
          warn "Could not find user #{email}"
          nil
        end
      else
        warn "Could not find user #{email}"
        nil
      end
    end
  else
    unless byemail['user']['login'].nil?
      info "Added user #{byemail['user']['login']} retrieved by email #{email}"
      retrieve_user_byusername(byemail['user']['login'])
    else
      u = byemail['user']
      unq = persister.store(:users, u)
      what = user_type(u['type'])
      info "Added user #{what} #{user}"
      u
    end
  end
end

#retrieve_user_byusername(user) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ghtorrent/retriever.rb', line 21

def retrieve_user_byusername(user)
  stored_user = persister.find(:users, {'login' => user})
  if stored_user.empty?
    url = ghurl "users/#{user}"
    u = api_request(url)

    if u.empty?
      return
    end

    unq = persister.store(:users, u)
    what = user_type(u['type'])
    info "Added user #{what} #{user}"
    u
  else
    what = user_type(stored_user.first['type'])
    debug "#{what} #{user} exists"
    stored_user.first
  end
end

#retrieve_user_follower(followed, follower) ⇒ Object



93
94
95
96
97
98
99
100
101
102
# File 'lib/ghtorrent/retriever.rb', line 93

def retrieve_user_follower(followed, follower)
  stored_item = persister.find(:followers, {'follows' => followed,
                                            'login' => follower})

  if stored_item.empty?
    retrieve_user_followers(followed).find{|x| x['login'] == follower}
  else
    stored_item.first
  end
end

#retrieve_user_followers(user) ⇒ Object



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/ghtorrent/retriever.rb', line 104

def retrieve_user_followers(user)
  followers = paged_api_request(ghurl "users/#{user}/followers")
  followers.each do |x|
    x['follows'] = user

    exists = !persister.find(:followers, {'follows' => user,
                                          'login' => x['login']}).empty?

    if not exists
      persister.store(:followers, x)
      info "Added follower #{user} -> #{x['login']}"
    else
      debug "Follower #{user} -> #{x['login']} exists"
    end
  end

  persister.find(:followers, {'follows' => user})
end

#retrieve_user_following(user) ⇒ Object



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/ghtorrent/retriever.rb', line 123

def retrieve_user_following(user)
  following = paged_api_request(ghurl "users/#{user}/following")
  user_followers_entry = nil

  following.each do |x|

    if user_followers_entry.nil?
      reverse_lookup = persister.find(:followers, {'follows' => x['login'],
                                                   'login' => user})
      if reverse_lookup.empty?
        user_followers_entry = retrieve_user_followers(x['login']).\
                                 find{|y| y['login'] == user}
      else
        user_followers_entry = reverse_lookup[0]
      end
    end

    exists = !persister.find(:followers, {'follows' => x['login'],
                                          'login' => user}).empty?
    if not exists
      user_followers_entry['follows'] = x['login']
      user_followers_entry.delete(:_id)
      user_followers_entry.delete('_id')
      a = persister.store(:followers, user_followers_entry)
      info "Added following #{user} -> #{x['login']}"
    else
      debug "Following #{user} -> #{x['login']} exists"
    end
  end

  persister.find(:followers, {'login' => user})
end

#retrieve_watcher(user, repo, watcher) ⇒ Object

Retrieve a single watcher for a repository



312
313
314
315
316
317
# File 'lib/ghtorrent/retriever.rb', line 312

def retrieve_watcher(user, repo, watcher)
  repo_bound_item(user, repo, watcher, :watchers,
                  ["repos/#{user}/#{repo}/stargazers"],
                  {'repo' => repo, 'owner' => user},
                  'login', order = :desc)
end

#retrieve_watchers(user, repo) ⇒ Object

Retrieve all watchers for a repository



304
305
306
307
308
309
# File 'lib/ghtorrent/retriever.rb', line 304

def retrieve_watchers(user, repo)
  repo_bound_items(user, repo, :watchers,
                   ["repos/#{user}/#{repo}/stargazers"],
                   {'repo' => repo, 'owner' => user},
                   'login', item = nil, refresh = false, order = :desc)
end