22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/chronicle/github/activity_extractor.rb', line 22
def
events = @client.user_events(username)
has_more = events.any?
count = 0
while has_more
events = events.first(@config.limit - count) if @config.limit
events = events.filter { |event| event.created_at > @config.since } if @config.since
break unless events.any?
events.each do |event|
count += 1
yield (data: event, meta: { user: @user })
end
break unless @client.last_response.rels[:next]
events = @client.get(@client.last_response.rels[:next].href)
has_more = events.any?
end
end
|