github_bot 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
- data/.github/ISSUE_TEMPLATE/config.yml +1 -1
- data/Gemfile +1 -0
- data/lib/github_bot/github/payload.rb +23 -3
- data/lib/github_bot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55e5c2085a789f760946a31c8045af4bd6cfbfbddd86a27b6a733d409f20f37e
|
4
|
+
data.tar.gz: 91de233efa71c6cd583d9d3a41496e6b01ffd9428aa73afdc0243a9430fa867c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06f5dc19cb2f0516277c46ecffce1031f1ac7d5e5e60a2302ed5cc58260926523418ba467c4b147469debf8310d64163f8ea1577a4e71fe5c0762f212f1ef9d6
|
7
|
+
data.tar.gz: 1466c3f469110542d78538254e0c489fb256020e0f1a3cea8dc3530a113426a28516dcdaf0031b8ec21718d7217c23d9d15cb177c43438a6e3ffbc693ad44961
|
@@ -9,7 +9,7 @@ assignees: ''
|
|
9
9
|
|
10
10
|
> Before reporting a bug
|
11
11
|
- [ ] Check the bug is reproducible.
|
12
|
-
- [ ] Search for [existing issues](https://github.com/
|
12
|
+
- [ ] Search for [existing issues](https://github.com/cerner/github_bot-ruby/issues).
|
13
13
|
|
14
14
|
**Describe the bug**
|
15
15
|
A clear and concise description of what the bug is.
|
data/Gemfile
CHANGED
@@ -16,6 +16,7 @@ gem 'rubocop-performance', '~> 1.8', require: false
|
|
16
16
|
gem 'rubocop-rake', '~> 0.5', require: false
|
17
17
|
gem 'rubocop-rspec', '~> 2.1', require: false
|
18
18
|
gem 'simplecov', '~> 0.19', require: false
|
19
|
+
gem 'timecop', '~> 0.9'
|
19
20
|
|
20
21
|
# debugging
|
21
22
|
gem 'debase', '~> 0.2.5.beta2'
|
@@ -135,15 +135,35 @@ module GithubBot
|
|
135
135
|
# Public: Returns the repository fork URL from the original project with the most
|
136
136
|
# recent updated forked instance first
|
137
137
|
#
|
138
|
+
# Utilizing API: https://docs.github.com/en/rest/reference/repos#forks
|
139
|
+
# Example: https://api.github.com/repos/octocat/Hello-World/forks?page=1
|
140
|
+
#
|
138
141
|
# @return [Array] The array of [String] URLs associated to the forked repositories
|
139
142
|
def repository_fork_urls
|
140
143
|
return @repository_fork_urls if @repository_fork_urls
|
141
144
|
|
142
145
|
@repository_fork_urls =
|
143
146
|
[].tap do |ar|
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
+
# iterate over pages of forks
|
148
|
+
page_count = 1
|
149
|
+
forks_url = repository[:forks_url]
|
150
|
+
loop do
|
151
|
+
uri = URI.parse(forks_url)
|
152
|
+
new_query_ar = URI.decode_www_form(String(uri.query)) << ['page', page_count]
|
153
|
+
uri.query = URI.encode_www_form(new_query_ar)
|
154
|
+
|
155
|
+
Rails.logger.info "#{self.class}##{__method__} retrieving #{uri}"
|
156
|
+
|
157
|
+
json = uri.open.read
|
158
|
+
json_response = JSON.parse(json)
|
159
|
+
break if json_response.empty?
|
160
|
+
|
161
|
+
# iterate over each fork and capture the clone_url
|
162
|
+
json_response.each do |fork|
|
163
|
+
ar << fork['clone_url']
|
164
|
+
end
|
165
|
+
|
166
|
+
page_count += 1
|
147
167
|
end
|
148
168
|
end
|
149
169
|
end
|
data/lib/github_bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Howdeshell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|