6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/ghtorrent/commands/full_user_retriever.rb', line 6
def retrieve_user(login)
user_entry = ght.transaction { ght.ensure_user(login, false, false) }
on_github = api_request(ghurl ("users/#{login}"))
if on_github.empty?
if user_entry.nil?
warn "User #{login} does not exist on GitHub"
exit
else
ght.transaction do
ght.get_db.from(:users).where(:login => login).update(:users__deleted => true)
end
warn "User #{login} marked as deleted"
return
end
else
if user_entry.nil?
warn "Error retrieving user #{login}"
exit
end
end
user = user_entry[:login]
def send_message(function, user)
begin
ght.send(function, user)
rescue StandardError => e
puts STDERR, e.message
puts STDERR, e.backtrace
end
end
functions = %w(ensure_user_following ensure_user_followers ensure_orgs ensure_org)
functions.each do |x|
send_message(x, user)
end
end
|