Class: TransactedGHTorrent
Overview
A version of the GHTorrent class that creates a transaction per processed item
Constant Summary
GHTorrent::Persister::ADAPTERS
GHTorrent::Settings::CONFIGKEYS, GHTorrent::Settings::DEFAULTS
Instance Attribute Summary
#logger, #persister, #settings
Instance Method Summary
collapse
-
#check_transaction(&block) ⇒ Object
-
#ensure_commit(repo, sha, user, comments = true) ⇒ Object
-
#ensure_commit_comment(owner, repo, sha, comment_id) ⇒ Object
-
#ensure_fork(owner, repo, fork_id) ⇒ Object
-
#ensure_fork_commits(owner, repo, parent_owner, parent_repo) ⇒ Object
-
#ensure_issue(owner, repo, issue_id, events = true, comments = true, labels = true) ⇒ Object
-
#ensure_issue_comment(owner, repo, issue_id, comment_id, pull_req_id = nil) ⇒ Object
-
#ensure_issue_event(owner, repo, issue_id, event_id) ⇒ Object
-
#ensure_issue_label(owner, repo, issue_id, name) ⇒ Object
-
#ensure_org(user, members = true) ⇒ Object
-
#ensure_orgs(user) ⇒ Object
-
#ensure_project_member(owner, repo, new_member, date_added) ⇒ Object
-
#ensure_pull_request(owner, repo, pullreq_id, comments = true, commits = true, history = true, state = nil, actor = nil, created_at = nil) ⇒ Object
-
#ensure_pullreq_comment(owner, repo, pullreq_id, comment_id) ⇒ Object
-
#ensure_repo(owner, repo, recursive = false) ⇒ Object
-
#ensure_repo_label(owner, repo, name) ⇒ Object
-
#ensure_user_followers(user) ⇒ Object
-
#ensure_watcher(owner, repo, watcher, date_added = nil) ⇒ Object
#boolean, #commit_user, #date, #dispose, #ensure_commit_comments, #ensure_commits, #ensure_forks, #ensure_issue_comments, #ensure_issue_events, #ensure_issue_labels, #ensure_issues, #ensure_labels, #ensure_languages, #ensure_parents, #ensure_participation, #ensure_project_members, #ensure_pull_request_commits, #ensure_pull_request_history, #ensure_pull_requests, #ensure_pullreq_comments, #ensure_repo_commit, #ensure_repo_recursive, #ensure_user, #ensure_user_byemail, #ensure_user_byuname, #ensure_user_follower, #ensure_user_following, #ensure_watchers, #get_db, #has_head_repo, #initialize, #is_intra_branch, #is_valid_email, #log_msg, #max, #save, #store_commit, #transaction
#connect, #disconnect
#get_event, #get_events, #get_repo_events, #persister, #retrieve_commit, #retrieve_commit_comment, #retrieve_commit_comments, #retrieve_commits, #retrieve_fork, #retrieve_forks, #retrieve_issue, #retrieve_issue_comment, #retrieve_issue_comments, #retrieve_issue_event, #retrieve_issue_events, #retrieve_issue_labels, #retrieve_issues, #retrieve_languages, #retrieve_org, #retrieve_org_members, #retrieve_orgs, #retrieve_pull_req_comment, #retrieve_pull_req_comments, #retrieve_pull_req_commits, #retrieve_pull_request, #retrieve_pull_requests, #retrieve_repo, #retrieve_repo_collaborator, #retrieve_repo_collaborators, #retrieve_repo_label, #retrieve_repo_labels, #retrieve_user_byemail, #retrieve_user_byusername, #retrieve_user_follower, #retrieve_user_followers, #retrieve_user_following, #retrieve_watcher, #retrieve_watchers
#debug, #error, #info, #loggerr, #warn
#config, #merge, #merge_config_values, #override_config, #settings
included, #read_value, #user_type, #write_value
#api_request, #num_pages, #paged_api_request
Instance Method Details
#check_transaction(&block) ⇒ Object
112
113
114
115
116
117
118
119
120
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 112
def check_transaction(&block)
if get_db.in_transaction?
yield block
else
transaction do
yield block
end
end
end
|
#ensure_commit(repo, sha, user, comments = true) ⇒ Object
14
15
16
17
18
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 14
def ensure_commit(repo, sha, user, = true)
check_transaction do
super(repo, sha, user, )
end
end
|
20
21
22
23
24
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 20
def (owner, repo, sha, )
check_transaction do
super(owner, repo, sha, )
end
end
|
#ensure_fork(owner, repo, fork_id) ⇒ Object
26
27
28
29
30
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 26
def ensure_fork(owner, repo, fork_id)
check_transaction do
super(owner, repo, fork_id)
end
end
|
#ensure_fork_commits(owner, repo, parent_owner, parent_repo) ⇒ Object
32
33
34
35
36
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 32
def ensure_fork_commits(owner, repo, parent_owner, parent_repo)
check_transaction do
super(owner, repo, parent_owner, parent_repo)
end
end
|
#ensure_issue(owner, repo, issue_id, events = true, comments = true, labels = true) ⇒ Object
52
53
54
55
56
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 52
def ensure_issue(owner, repo, issue_id, events = true, = true, labels = true)
check_transaction do
super(owner, repo, issue_id, events, , labels)
end
end
|
64
65
66
67
68
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 64
def (owner, repo, issue_id, , pull_req_id = nil)
check_transaction do
super(owner, repo, issue_id, , pull_req_id)
end
end
|
#ensure_issue_event(owner, repo, issue_id, event_id) ⇒ Object
58
59
60
61
62
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 58
def ensure_issue_event(owner, repo, issue_id, event_id)
check_transaction do
super(owner, repo, issue_id, event_id)
end
end
|
#ensure_issue_label(owner, repo, issue_id, name) ⇒ Object
70
71
72
73
74
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 70
def ensure_issue_label(owner, repo, issue_id, name)
check_transaction do
super(owner, repo, issue_id, name)
end
end
|
#ensure_org(user, members = true) ⇒ Object
106
107
108
109
110
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 106
def ensure_org(user, members = true)
check_transaction do
super(user, members)
end
end
|
#ensure_orgs(user) ⇒ Object
100
101
102
103
104
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 100
def ensure_orgs(user)
check_transaction do
super(user)
end
end
|
#ensure_project_member(owner, repo, new_member, date_added) ⇒ Object
76
77
78
79
80
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 76
def ensure_project_member(owner, repo, new_member, date_added)
check_transaction do
super(owner, repo, new_member, date_added)
end
end
|
#ensure_pull_request(owner, repo, pullreq_id, comments = true, commits = true, history = true, state = nil, actor = nil, created_at = nil) ⇒ Object
38
39
40
41
42
43
44
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 38
def ensure_pull_request(owner, repo, pullreq_id,
= true, commits = true, history = true,
state = nil, actor = nil, created_at = nil)
check_transaction do
super(owner, repo, pullreq_id, , commits, history, state, actor, created_at)
end
end
|
46
47
48
49
50
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 46
def (owner, repo, pullreq_id, )
check_transaction do
super(owner, repo, pullreq_id, )
end
end
|
#ensure_repo(owner, repo, recursive = false) ⇒ Object
8
9
10
11
12
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 8
def ensure_repo(owner, repo, recursive = false)
check_transaction do
super(owner, repo, recursive)
end
end
|
#ensure_repo_label(owner, repo, name) ⇒ Object
88
89
90
91
92
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 88
def ensure_repo_label(owner, repo, name)
check_transaction do
super(owner, repo, name)
end
end
|
#ensure_user_followers(user) ⇒ Object
94
95
96
97
98
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 94
def ensure_user_followers(user)
check_transaction do
super(user)
end
end
|
#ensure_watcher(owner, repo, watcher, date_added = nil) ⇒ Object
82
83
84
85
86
|
# File 'lib/ghtorrent/transacted_gh_torrent.rb', line 82
def ensure_watcher(owner, repo, watcher, date_added = nil)
check_transaction do
super(owner, repo, watcher, date_added)
end
end
|