|
3 | 3 | require 'optparse' |
4 | 4 | require 'optparse/date' |
5 | 5 |
|
6 | | - |
7 | 6 | class InactiveMemberSearch |
8 | 7 | attr_accessor :organization, :members, :repositories, :date, :unrecognized_authors |
9 | 8 |
|
@@ -129,46 +128,34 @@ def commit_activity(repo) |
129 | 128 |
|
130 | 129 | def issue_activity(repo, date=@date) |
131 | 130 | # get all issues after specified date and iterate |
132 | | - info "...issues" |
133 | | - begin |
134 | | - @client.list_issues(repo, { :since => date }).each do |issue| |
135 | | - # if creator is a member of the org and not active, make active |
136 | | - if t = @members.find {|member| member[:login] == issue["user"]["login"] && member[:active] == false } |
137 | | - make_active(t[:login]) |
138 | | - end |
| 131 | + info "...Issues" |
| 132 | + @client.list_issues(repo, { :since => date }).each do |issue| |
| 133 | + # if creator is a member of the org and not active, make active |
| 134 | + if t = @members.find {|member| member[:login] == issue["user"]["login"] && member[:active] == false } |
| 135 | + make_active(t[:login]) |
139 | 136 | end |
140 | | - rescue |
141 | | - info "... no issues to check" |
142 | 137 | end |
143 | 138 | end |
144 | 139 |
|
145 | 140 | def issue_comment_activity(repo, date=@date) |
146 | 141 | # get all issue comments after specified date and iterate |
147 | | - info "...issue comments" |
148 | | - begin |
149 | | - @client.issues_comments(repo, { :since => date}).each do |comment| |
150 | | - # if commenter is a member of the org and not active, make active |
151 | | - if t = @members.find {|member| member[:login] == comment["user"]["login"] && member[:active] == false } |
152 | | - make_active(t[:login]) |
153 | | - end |
| 142 | + info "...Issue comments" |
| 143 | + @client.issues_comments(repo, { :since => date}).each do |comment| |
| 144 | + # if commenter is a member of the org and not active, make active |
| 145 | + if t = @members.find {|member| member[:login] == comment["user"]["login"] && member[:active] == false } |
| 146 | + make_active(t[:login]) |
154 | 147 | end |
155 | | - rescue |
156 | | - info "...no issues comments to check" |
157 | 148 | end |
158 | 149 | end |
159 | 150 |
|
160 | 151 | def pr_activity(repo, date=@date) |
161 | 152 | # get all pull request comments comments after specified date and iterate |
162 | | - info "...pr comments" |
163 | | - begin |
164 | | - @client.pull_requests_comments(repo, { :since => date}).each do |comment| |
165 | | - # if commenter is a member of the org and not active, make active |
166 | | - if t = @members.find {|member| member[:login] == comment["user"]["login"] && member[:active] == false } |
167 | | - make_active(t[:login]) |
168 | | - end |
| 153 | + info "...Pull Request comments" |
| 154 | + @client.pull_requests_comments(repo, { :since => date}).each do |comment| |
| 155 | + # if commenter is a member of the org and not active, make active |
| 156 | + if t = @members.find {|member| member[:login] == comment["user"]["login"] && member[:active] == false } |
| 157 | + make_active(t[:login]) |
169 | 158 | end |
170 | | - rescue |
171 | | - info "...no pr comments to check" |
172 | 159 | end |
173 | 160 | end |
174 | 161 |
|
|
0 commit comments