inq 26.0.0
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 +7 -0
- data/.cirrus.yml +84 -0
- data/.codeclimate.yml +23 -0
- data/.github_changelog_generator +2 -0
- data/.gitignore +15 -0
- data/.rspec +2 -0
- data/.rubocop.yml +260 -0
- data/.travis.yml +24 -0
- data/CHANGELOG.md +499 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/CONTRIBUTING.md +34 -0
- data/Gemfile +15 -0
- data/ISSUES.md +62 -0
- data/LICENSE.txt +21 -0
- data/README.md +91 -0
- data/Rakefile +76 -0
- data/bin/console +14 -0
- data/bin/prerelease-generate-changelog +28 -0
- data/bin/setup +8 -0
- data/bors.toml +17 -0
- data/build-debug.rb +20 -0
- data/exe/inq +7 -0
- data/fixtures/vcr_cassettes/how-is-example-empty-repository.yml +597 -0
- data/fixtures/vcr_cassettes/how-is-example-repository.yml +768 -0
- data/fixtures/vcr_cassettes/how-is-from-config-frontmatter.yml +23940 -0
- data/fixtures/vcr_cassettes/how-is-how-is-travis-api-repos-builds.yml +66 -0
- data/fixtures/vcr_cassettes/how-is-with-config-file.yml +23940 -0
- data/fixtures/vcr_cassettes/how_is_contributions_additions_count.yml +247 -0
- data/fixtures/vcr_cassettes/how_is_contributions_all_contributors.yml +247 -0
- data/fixtures/vcr_cassettes/how_is_contributions_changed_files.yml +247 -0
- data/fixtures/vcr_cassettes/how_is_contributions_changes.yml +247 -0
- data/fixtures/vcr_cassettes/how_is_contributions_commits.yml +247 -0
- data/fixtures/vcr_cassettes/how_is_contributions_compare_url.yml +81 -0
- data/fixtures/vcr_cassettes/how_is_contributions_default_branch.yml +81 -0
- data/fixtures/vcr_cassettes/how_is_contributions_deletions_count.yml +247 -0
- data/fixtures/vcr_cassettes/how_is_contributions_new_contributors.yml +402 -0
- data/fixtures/vcr_cassettes/how_is_contributions_summary.yml +325 -0
- data/fixtures/vcr_cassettes/how_is_contributions_summary_2.yml +325 -0
- data/inq.gemspec +45 -0
- data/lib/inq.rb +63 -0
- data/lib/inq/cacheable.rb +71 -0
- data/lib/inq/cli.rb +135 -0
- data/lib/inq/config.rb +123 -0
- data/lib/inq/constants.rb +9 -0
- data/lib/inq/date_time_helpers.rb +48 -0
- data/lib/inq/exe.rb +66 -0
- data/lib/inq/frontmatter.rb +51 -0
- data/lib/inq/report.rb +140 -0
- data/lib/inq/report_collection.rb +113 -0
- data/lib/inq/sources.rb +11 -0
- data/lib/inq/sources/ci/appveyor.rb +87 -0
- data/lib/inq/sources/ci/travis.rb +159 -0
- data/lib/inq/sources/github.rb +57 -0
- data/lib/inq/sources/github/contributions.rb +204 -0
- data/lib/inq/sources/github/issue_fetcher.rb +148 -0
- data/lib/inq/sources/github/issues.rb +126 -0
- data/lib/inq/sources/github/pulls.rb +29 -0
- data/lib/inq/sources/github_helpers.rb +106 -0
- data/lib/inq/template.rb +9 -0
- data/lib/inq/templates/contributions_partial.html +1 -0
- data/lib/inq/templates/issues_or_pulls_partial.html +7 -0
- data/lib/inq/templates/new_contributors_partial.html +5 -0
- data/lib/inq/templates/report.html +19 -0
- data/lib/inq/templates/report_partial.html +12 -0
- data/lib/inq/text.rb +26 -0
- data/lib/inq/version.rb +6 -0
- metadata +263 -0
@@ -0,0 +1,325 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.github.com/repos/how-is/example-repository
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
|
12
|
+
Accept-Charset:
|
13
|
+
- utf-8
|
14
|
+
User-Agent:
|
15
|
+
- Github API Ruby Gem 0.18.2
|
16
|
+
Authorization:
|
17
|
+
- Basic ZHVja2luYXRvcjo5MTgyNzc3ZmYzYzAwNjc5NTE5M2E1NzBjZGFjMzI2YjY0NDU5ZGM5
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- GitHub.com
|
27
|
+
Date:
|
28
|
+
- Wed, 01 May 2019 13:51:00 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Status:
|
34
|
+
- 200 OK
|
35
|
+
X-Ratelimit-Limit:
|
36
|
+
- '5000'
|
37
|
+
X-Ratelimit-Remaining:
|
38
|
+
- '4922'
|
39
|
+
X-Ratelimit-Reset:
|
40
|
+
- '1556722011'
|
41
|
+
Cache-Control:
|
42
|
+
- private, max-age=60, s-maxage=60
|
43
|
+
Vary:
|
44
|
+
- Accept, Authorization, Cookie, X-GitHub-OTP
|
45
|
+
Etag:
|
46
|
+
- W/"0e7a2b8cb1d4abfed8e64ef6d9b2871f"
|
47
|
+
Last-Modified:
|
48
|
+
- Sun, 07 Aug 2016 03:52:53 GMT
|
49
|
+
X-Oauth-Scopes:
|
50
|
+
- ''
|
51
|
+
X-Accepted-Oauth-Scopes:
|
52
|
+
- repo
|
53
|
+
X-Github-Media-Type:
|
54
|
+
- github.v3; format=json
|
55
|
+
Access-Control-Expose-Headers:
|
56
|
+
- ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
|
57
|
+
X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval,
|
58
|
+
X-GitHub-Media-Type
|
59
|
+
Access-Control-Allow-Origin:
|
60
|
+
- "*"
|
61
|
+
Strict-Transport-Security:
|
62
|
+
- max-age=31536000; includeSubdomains; preload
|
63
|
+
X-Frame-Options:
|
64
|
+
- deny
|
65
|
+
X-Content-Type-Options:
|
66
|
+
- nosniff
|
67
|
+
X-Xss-Protection:
|
68
|
+
- 1; mode=block
|
69
|
+
Referrer-Policy:
|
70
|
+
- origin-when-cross-origin, strict-origin-when-cross-origin
|
71
|
+
Content-Security-Policy:
|
72
|
+
- default-src 'none'
|
73
|
+
X-Github-Request-Id:
|
74
|
+
- 7D67:4228:1857A8:3B68A8:5CC9A444
|
75
|
+
body:
|
76
|
+
encoding: ASCII-8BIT
|
77
|
+
string: '{"id":65114449,"node_id":"MDEwOlJlcG9zaXRvcnk2NTExNDQ0OQ==","name":"example-repository","full_name":"how-is/example-repository","private":false,"owner":{"login":"how-is","id":20577802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNTc3ODAy","avatar_url":"https://avatars0.githubusercontent.com/u/20577802?v=4","gravatar_id":"","url":"https://api.github.com/users/how-is","html_url":"https://github.com/how-is","followers_url":"https://api.github.com/users/how-is/followers","following_url":"https://api.github.com/users/how-is/following{/other_user}","gists_url":"https://api.github.com/users/how-is/gists{/gist_id}","starred_url":"https://api.github.com/users/how-is/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/how-is/subscriptions","organizations_url":"https://api.github.com/users/how-is/orgs","repos_url":"https://api.github.com/users/how-is/repos","events_url":"https://api.github.com/users/how-is/events{/privacy}","received_events_url":"https://api.github.com/users/how-is/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/how-is/example-repository","description":"Example
|
78
|
+
repository for testing how_is.","fork":false,"url":"https://api.github.com/repos/how-is/example-repository","forks_url":"https://api.github.com/repos/how-is/example-repository/forks","keys_url":"https://api.github.com/repos/how-is/example-repository/keys{/key_id}","collaborators_url":"https://api.github.com/repos/how-is/example-repository/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/how-is/example-repository/teams","hooks_url":"https://api.github.com/repos/how-is/example-repository/hooks","issue_events_url":"https://api.github.com/repos/how-is/example-repository/issues/events{/number}","events_url":"https://api.github.com/repos/how-is/example-repository/events","assignees_url":"https://api.github.com/repos/how-is/example-repository/assignees{/user}","branches_url":"https://api.github.com/repos/how-is/example-repository/branches{/branch}","tags_url":"https://api.github.com/repos/how-is/example-repository/tags","blobs_url":"https://api.github.com/repos/how-is/example-repository/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/how-is/example-repository/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/how-is/example-repository/git/refs{/sha}","trees_url":"https://api.github.com/repos/how-is/example-repository/git/trees{/sha}","statuses_url":"https://api.github.com/repos/how-is/example-repository/statuses/{sha}","languages_url":"https://api.github.com/repos/how-is/example-repository/languages","stargazers_url":"https://api.github.com/repos/how-is/example-repository/stargazers","contributors_url":"https://api.github.com/repos/how-is/example-repository/contributors","subscribers_url":"https://api.github.com/repos/how-is/example-repository/subscribers","subscription_url":"https://api.github.com/repos/how-is/example-repository/subscription","commits_url":"https://api.github.com/repos/how-is/example-repository/commits{/sha}","git_commits_url":"https://api.github.com/repos/how-is/example-repository/git/commits{/sha}","comments_url":"https://api.github.com/repos/how-is/example-repository/comments{/number}","issue_comment_url":"https://api.github.com/repos/how-is/example-repository/issues/comments{/number}","contents_url":"https://api.github.com/repos/how-is/example-repository/contents/{+path}","compare_url":"https://api.github.com/repos/how-is/example-repository/compare/{base}...{head}","merges_url":"https://api.github.com/repos/how-is/example-repository/merges","archive_url":"https://api.github.com/repos/how-is/example-repository/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/how-is/example-repository/downloads","issues_url":"https://api.github.com/repos/how-is/example-repository/issues{/number}","pulls_url":"https://api.github.com/repos/how-is/example-repository/pulls{/number}","milestones_url":"https://api.github.com/repos/how-is/example-repository/milestones{/number}","notifications_url":"https://api.github.com/repos/how-is/example-repository/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/how-is/example-repository/labels{/name}","releases_url":"https://api.github.com/repos/how-is/example-repository/releases{/id}","deployments_url":"https://api.github.com/repos/how-is/example-repository/deployments","created_at":"2016-08-07T03:52:53Z","updated_at":"2016-08-07T03:52:53Z","pushed_at":"2017-08-05T20:39:30Z","git_url":"git://github.com/how-is/example-repository.git","ssh_url":"git@github.com:how-is/example-repository.git","clone_url":"https://github.com/how-is/example-repository.git","svn_url":"https://github.com/how-is/example-repository","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"organization":{"login":"how-is","id":20577802,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNTc3ODAy","avatar_url":"https://avatars0.githubusercontent.com/u/20577802?v=4","gravatar_id":"","url":"https://api.github.com/users/how-is","html_url":"https://github.com/how-is","followers_url":"https://api.github.com/users/how-is/followers","following_url":"https://api.github.com/users/how-is/following{/other_user}","gists_url":"https://api.github.com/users/how-is/gists{/gist_id}","starred_url":"https://api.github.com/users/how-is/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/how-is/subscriptions","organizations_url":"https://api.github.com/users/how-is/orgs","repos_url":"https://api.github.com/users/how-is/repos","events_url":"https://api.github.com/users/how-is/events{/privacy}","received_events_url":"https://api.github.com/users/how-is/received_events","type":"Organization","site_admin":false},"network_count":0,"subscribers_count":1}'
|
79
|
+
http_version:
|
80
|
+
recorded_at: Wed, 01 May 2019 13:51:00 GMT
|
81
|
+
- request:
|
82
|
+
method: get
|
83
|
+
uri: https://api.github.com/repos/how-is/example-repository/commits?since=2017-08-01&until=2017-09-01
|
84
|
+
body:
|
85
|
+
encoding: US-ASCII
|
86
|
+
string: ''
|
87
|
+
headers:
|
88
|
+
Accept:
|
89
|
+
- application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
|
90
|
+
Accept-Charset:
|
91
|
+
- utf-8
|
92
|
+
User-Agent:
|
93
|
+
- Github API Ruby Gem 0.18.2
|
94
|
+
Authorization:
|
95
|
+
- Basic ZHVja2luYXRvcjo5MTgyNzc3ZmYzYzAwNjc5NTE5M2E1NzBjZGFjMzI2YjY0NDU5ZGM5
|
96
|
+
Accept-Encoding:
|
97
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
98
|
+
response:
|
99
|
+
status:
|
100
|
+
code: 200
|
101
|
+
message: OK
|
102
|
+
headers:
|
103
|
+
Server:
|
104
|
+
- GitHub.com
|
105
|
+
Date:
|
106
|
+
- Wed, 01 May 2019 13:51:00 GMT
|
107
|
+
Content-Type:
|
108
|
+
- application/json; charset=utf-8
|
109
|
+
Transfer-Encoding:
|
110
|
+
- chunked
|
111
|
+
Status:
|
112
|
+
- 200 OK
|
113
|
+
X-Ratelimit-Limit:
|
114
|
+
- '5000'
|
115
|
+
X-Ratelimit-Remaining:
|
116
|
+
- '4921'
|
117
|
+
X-Ratelimit-Reset:
|
118
|
+
- '1556722011'
|
119
|
+
Cache-Control:
|
120
|
+
- private, max-age=60, s-maxage=60
|
121
|
+
Vary:
|
122
|
+
- Accept, Authorization, Cookie, X-GitHub-OTP
|
123
|
+
Etag:
|
124
|
+
- W/"e06dc0e42f8cfc1024c76afcf8a5c981"
|
125
|
+
Last-Modified:
|
126
|
+
- Sat, 05 Aug 2017 20:39:01 GMT
|
127
|
+
X-Oauth-Scopes:
|
128
|
+
- ''
|
129
|
+
X-Accepted-Oauth-Scopes:
|
130
|
+
- ''
|
131
|
+
X-Github-Media-Type:
|
132
|
+
- github.v3; format=json
|
133
|
+
Access-Control-Expose-Headers:
|
134
|
+
- ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
|
135
|
+
X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval,
|
136
|
+
X-GitHub-Media-Type
|
137
|
+
Access-Control-Allow-Origin:
|
138
|
+
- "*"
|
139
|
+
Strict-Transport-Security:
|
140
|
+
- max-age=31536000; includeSubdomains; preload
|
141
|
+
X-Frame-Options:
|
142
|
+
- deny
|
143
|
+
X-Content-Type-Options:
|
144
|
+
- nosniff
|
145
|
+
X-Xss-Protection:
|
146
|
+
- 1; mode=block
|
147
|
+
Referrer-Policy:
|
148
|
+
- origin-when-cross-origin, strict-origin-when-cross-origin
|
149
|
+
Content-Security-Policy:
|
150
|
+
- default-src 'none'
|
151
|
+
X-Github-Request-Id:
|
152
|
+
- 1534:1511:359B97:6DF749:5CC9A444
|
153
|
+
body:
|
154
|
+
encoding: ASCII-8BIT
|
155
|
+
string: '[{"sha":"40c01ab6ebec6cbd8ad9e521a732f941c169e557","node_id":"MDY6Q29tbWl0NjUxMTQ0NDk6NDBjMDFhYjZlYmVjNmNiZDhhZDllNTIxYTczMmY5NDFjMTY5ZTU1Nw==","commit":{"author":{"name":"Ellen
|
156
|
+
Marie Dash","email":"me@duckie.co","date":"2017-08-05T20:39:01Z"},"committer":{"name":"Ellen
|
157
|
+
Marie Dash","email":"me@duckie.co","date":"2017-08-05T20:39:01Z"},"message":"meep","tree":{"sha":"6911e0637822f44b83f04f47821adab56fdbc0b9","url":"https://api.github.com/repos/how-is/example-repository/git/trees/6911e0637822f44b83f04f47821adab56fdbc0b9"},"url":"https://api.github.com/repos/how-is/example-repository/git/commits/40c01ab6ebec6cbd8ad9e521a732f941c169e557","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null}},"url":"https://api.github.com/repos/how-is/example-repository/commits/40c01ab6ebec6cbd8ad9e521a732f941c169e557","html_url":"https://github.com/how-is/example-repository/commit/40c01ab6ebec6cbd8ad9e521a732f941c169e557","comments_url":"https://api.github.com/repos/how-is/example-repository/commits/40c01ab6ebec6cbd8ad9e521a732f941c169e557/comments","author":{"login":"duckinator","id":39698,"node_id":"MDQ6VXNlcjM5Njk4","avatar_url":"https://avatars3.githubusercontent.com/u/39698?v=4","gravatar_id":"","url":"https://api.github.com/users/duckinator","html_url":"https://github.com/duckinator","followers_url":"https://api.github.com/users/duckinator/followers","following_url":"https://api.github.com/users/duckinator/following{/other_user}","gists_url":"https://api.github.com/users/duckinator/gists{/gist_id}","starred_url":"https://api.github.com/users/duckinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckinator/subscriptions","organizations_url":"https://api.github.com/users/duckinator/orgs","repos_url":"https://api.github.com/users/duckinator/repos","events_url":"https://api.github.com/users/duckinator/events{/privacy}","received_events_url":"https://api.github.com/users/duckinator/received_events","type":"User","site_admin":false},"committer":{"login":"duckinator","id":39698,"node_id":"MDQ6VXNlcjM5Njk4","avatar_url":"https://avatars3.githubusercontent.com/u/39698?v=4","gravatar_id":"","url":"https://api.github.com/users/duckinator","html_url":"https://github.com/duckinator","followers_url":"https://api.github.com/users/duckinator/followers","following_url":"https://api.github.com/users/duckinator/following{/other_user}","gists_url":"https://api.github.com/users/duckinator/gists{/gist_id}","starred_url":"https://api.github.com/users/duckinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckinator/subscriptions","organizations_url":"https://api.github.com/users/duckinator/orgs","repos_url":"https://api.github.com/users/duckinator/repos","events_url":"https://api.github.com/users/duckinator/events{/privacy}","received_events_url":"https://api.github.com/users/duckinator/received_events","type":"User","site_admin":false},"parents":[{"sha":"3794aa1c4b76623748faf280abe5760b76823162","url":"https://api.github.com/repos/how-is/example-repository/commits/3794aa1c4b76623748faf280abe5760b76823162","html_url":"https://github.com/how-is/example-repository/commit/3794aa1c4b76623748faf280abe5760b76823162"}]},{"sha":"3794aa1c4b76623748faf280abe5760b76823162","node_id":"MDY6Q29tbWl0NjUxMTQ0NDk6Mzc5NGFhMWM0Yjc2NjIzNzQ4ZmFmMjgwYWJlNTc2MGI3NjgyMzE2Mg==","commit":{"author":{"name":"fake
|
158
|
+
author","email":"fake@duckinator.net","date":"2017-08-05T20:23:10Z"},"committer":{"name":"fake
|
159
|
+
author","email":"fake@duckinator.net","date":"2017-08-05T20:23:10Z"},"message":"test
|
160
|
+
commit","tree":{"sha":"8286e548e330cfe01efcf7189f4df1fa53e777a7","url":"https://api.github.com/repos/how-is/example-repository/git/trees/8286e548e330cfe01efcf7189f4df1fa53e777a7"},"url":"https://api.github.com/repos/how-is/example-repository/git/commits/3794aa1c4b76623748faf280abe5760b76823162","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null}},"url":"https://api.github.com/repos/how-is/example-repository/commits/3794aa1c4b76623748faf280abe5760b76823162","html_url":"https://github.com/how-is/example-repository/commit/3794aa1c4b76623748faf280abe5760b76823162","comments_url":"https://api.github.com/repos/how-is/example-repository/commits/3794aa1c4b76623748faf280abe5760b76823162/comments","author":null,"committer":null,"parents":[{"sha":"9e29405efa433529b86722542b8fb4b34dfd9edd","url":"https://api.github.com/repos/how-is/example-repository/commits/9e29405efa433529b86722542b8fb4b34dfd9edd","html_url":"https://github.com/how-is/example-repository/commit/9e29405efa433529b86722542b8fb4b34dfd9edd"}]}]'
|
161
|
+
http_version:
|
162
|
+
recorded_at: Wed, 01 May 2019 13:51:00 GMT
|
163
|
+
- request:
|
164
|
+
method: get
|
165
|
+
uri: https://api.github.com/repos/how-is/example-repository/commits/40c01ab6ebec6cbd8ad9e521a732f941c169e557
|
166
|
+
body:
|
167
|
+
encoding: US-ASCII
|
168
|
+
string: ''
|
169
|
+
headers:
|
170
|
+
Accept:
|
171
|
+
- application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
|
172
|
+
Accept-Charset:
|
173
|
+
- utf-8
|
174
|
+
User-Agent:
|
175
|
+
- Github API Ruby Gem 0.18.2
|
176
|
+
Authorization:
|
177
|
+
- Basic ZHVja2luYXRvcjo5MTgyNzc3ZmYzYzAwNjc5NTE5M2E1NzBjZGFjMzI2YjY0NDU5ZGM5
|
178
|
+
Accept-Encoding:
|
179
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
180
|
+
response:
|
181
|
+
status:
|
182
|
+
code: 200
|
183
|
+
message: OK
|
184
|
+
headers:
|
185
|
+
Server:
|
186
|
+
- GitHub.com
|
187
|
+
Date:
|
188
|
+
- Wed, 01 May 2019 13:51:00 GMT
|
189
|
+
Content-Type:
|
190
|
+
- application/json; charset=utf-8
|
191
|
+
Transfer-Encoding:
|
192
|
+
- chunked
|
193
|
+
Status:
|
194
|
+
- 200 OK
|
195
|
+
X-Ratelimit-Limit:
|
196
|
+
- '5000'
|
197
|
+
X-Ratelimit-Remaining:
|
198
|
+
- '4920'
|
199
|
+
X-Ratelimit-Reset:
|
200
|
+
- '1556722011'
|
201
|
+
Cache-Control:
|
202
|
+
- private, max-age=60, s-maxage=60
|
203
|
+
Vary:
|
204
|
+
- Accept, Authorization, Cookie, X-GitHub-OTP
|
205
|
+
Etag:
|
206
|
+
- W/"f8a0e4683716d0a448cfd4b2f9452fe7"
|
207
|
+
Last-Modified:
|
208
|
+
- Sat, 05 Aug 2017 20:39:01 GMT
|
209
|
+
X-Oauth-Scopes:
|
210
|
+
- ''
|
211
|
+
X-Accepted-Oauth-Scopes:
|
212
|
+
- ''
|
213
|
+
X-Github-Media-Type:
|
214
|
+
- github.v3; format=json
|
215
|
+
Access-Control-Expose-Headers:
|
216
|
+
- ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
|
217
|
+
X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval,
|
218
|
+
X-GitHub-Media-Type
|
219
|
+
Access-Control-Allow-Origin:
|
220
|
+
- "*"
|
221
|
+
Strict-Transport-Security:
|
222
|
+
- max-age=31536000; includeSubdomains; preload
|
223
|
+
X-Frame-Options:
|
224
|
+
- deny
|
225
|
+
X-Content-Type-Options:
|
226
|
+
- nosniff
|
227
|
+
X-Xss-Protection:
|
228
|
+
- 1; mode=block
|
229
|
+
Referrer-Policy:
|
230
|
+
- origin-when-cross-origin, strict-origin-when-cross-origin
|
231
|
+
Content-Security-Policy:
|
232
|
+
- default-src 'none'
|
233
|
+
X-Github-Request-Id:
|
234
|
+
- 6F33:6F00:27FB77:57045C:5CC9A444
|
235
|
+
body:
|
236
|
+
encoding: ASCII-8BIT
|
237
|
+
string: '{"sha":"40c01ab6ebec6cbd8ad9e521a732f941c169e557","node_id":"MDY6Q29tbWl0NjUxMTQ0NDk6NDBjMDFhYjZlYmVjNmNiZDhhZDllNTIxYTczMmY5NDFjMTY5ZTU1Nw==","commit":{"author":{"name":"Ellen
|
238
|
+
Marie Dash","email":"me@duckie.co","date":"2017-08-05T20:39:01Z"},"committer":{"name":"Ellen
|
239
|
+
Marie Dash","email":"me@duckie.co","date":"2017-08-05T20:39:01Z"},"message":"meep","tree":{"sha":"6911e0637822f44b83f04f47821adab56fdbc0b9","url":"https://api.github.com/repos/how-is/example-repository/git/trees/6911e0637822f44b83f04f47821adab56fdbc0b9"},"url":"https://api.github.com/repos/how-is/example-repository/git/commits/40c01ab6ebec6cbd8ad9e521a732f941c169e557","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null}},"url":"https://api.github.com/repos/how-is/example-repository/commits/40c01ab6ebec6cbd8ad9e521a732f941c169e557","html_url":"https://github.com/how-is/example-repository/commit/40c01ab6ebec6cbd8ad9e521a732f941c169e557","comments_url":"https://api.github.com/repos/how-is/example-repository/commits/40c01ab6ebec6cbd8ad9e521a732f941c169e557/comments","author":{"login":"duckinator","id":39698,"node_id":"MDQ6VXNlcjM5Njk4","avatar_url":"https://avatars3.githubusercontent.com/u/39698?v=4","gravatar_id":"","url":"https://api.github.com/users/duckinator","html_url":"https://github.com/duckinator","followers_url":"https://api.github.com/users/duckinator/followers","following_url":"https://api.github.com/users/duckinator/following{/other_user}","gists_url":"https://api.github.com/users/duckinator/gists{/gist_id}","starred_url":"https://api.github.com/users/duckinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckinator/subscriptions","organizations_url":"https://api.github.com/users/duckinator/orgs","repos_url":"https://api.github.com/users/duckinator/repos","events_url":"https://api.github.com/users/duckinator/events{/privacy}","received_events_url":"https://api.github.com/users/duckinator/received_events","type":"User","site_admin":false},"committer":{"login":"duckinator","id":39698,"node_id":"MDQ6VXNlcjM5Njk4","avatar_url":"https://avatars3.githubusercontent.com/u/39698?v=4","gravatar_id":"","url":"https://api.github.com/users/duckinator","html_url":"https://github.com/duckinator","followers_url":"https://api.github.com/users/duckinator/followers","following_url":"https://api.github.com/users/duckinator/following{/other_user}","gists_url":"https://api.github.com/users/duckinator/gists{/gist_id}","starred_url":"https://api.github.com/users/duckinator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckinator/subscriptions","organizations_url":"https://api.github.com/users/duckinator/orgs","repos_url":"https://api.github.com/users/duckinator/repos","events_url":"https://api.github.com/users/duckinator/events{/privacy}","received_events_url":"https://api.github.com/users/duckinator/received_events","type":"User","site_admin":false},"parents":[{"sha":"3794aa1c4b76623748faf280abe5760b76823162","url":"https://api.github.com/repos/how-is/example-repository/commits/3794aa1c4b76623748faf280abe5760b76823162","html_url":"https://github.com/how-is/example-repository/commit/3794aa1c4b76623748faf280abe5760b76823162"}],"stats":{"total":2,"additions":1,"deletions":1},"files":[{"sha":"1573b3cd673938ed5f9ee8c41952c77b456ffab9","filename":"README.md","status":"modified","additions":1,"deletions":1,"changes":2,"blob_url":"https://github.com/how-is/example-repository/blob/40c01ab6ebec6cbd8ad9e521a732f941c169e557/README.md","raw_url":"https://github.com/how-is/example-repository/raw/40c01ab6ebec6cbd8ad9e521a732f941c169e557/README.md","contents_url":"https://api.github.com/repos/how-is/example-repository/contents/README.md?ref=40c01ab6ebec6cbd8ad9e521a732f941c169e557","patch":"@@
|
240
|
+
-1,3 +1,3 @@\n # example-repository\n \n-Example repository for testing how_is.\n+An
|
241
|
+
example repository for testing how_is."}]}'
|
242
|
+
http_version:
|
243
|
+
recorded_at: Wed, 01 May 2019 13:51:00 GMT
|
244
|
+
- request:
|
245
|
+
method: get
|
246
|
+
uri: https://api.github.com/repos/how-is/example-repository/commits/3794aa1c4b76623748faf280abe5760b76823162
|
247
|
+
body:
|
248
|
+
encoding: US-ASCII
|
249
|
+
string: ''
|
250
|
+
headers:
|
251
|
+
Accept:
|
252
|
+
- application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
|
253
|
+
Accept-Charset:
|
254
|
+
- utf-8
|
255
|
+
User-Agent:
|
256
|
+
- Github API Ruby Gem 0.18.2
|
257
|
+
Authorization:
|
258
|
+
- Basic ZHVja2luYXRvcjo5MTgyNzc3ZmYzYzAwNjc5NTE5M2E1NzBjZGFjMzI2YjY0NDU5ZGM5
|
259
|
+
Accept-Encoding:
|
260
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
261
|
+
response:
|
262
|
+
status:
|
263
|
+
code: 200
|
264
|
+
message: OK
|
265
|
+
headers:
|
266
|
+
Server:
|
267
|
+
- GitHub.com
|
268
|
+
Date:
|
269
|
+
- Wed, 01 May 2019 13:51:00 GMT
|
270
|
+
Content-Type:
|
271
|
+
- application/json; charset=utf-8
|
272
|
+
Transfer-Encoding:
|
273
|
+
- chunked
|
274
|
+
Status:
|
275
|
+
- 200 OK
|
276
|
+
X-Ratelimit-Limit:
|
277
|
+
- '5000'
|
278
|
+
X-Ratelimit-Remaining:
|
279
|
+
- '4919'
|
280
|
+
X-Ratelimit-Reset:
|
281
|
+
- '1556722011'
|
282
|
+
Cache-Control:
|
283
|
+
- private, max-age=60, s-maxage=60
|
284
|
+
Vary:
|
285
|
+
- Accept, Authorization, Cookie, X-GitHub-OTP
|
286
|
+
Etag:
|
287
|
+
- W/"47d4a35f0ff1ae30066ad87f1e818730"
|
288
|
+
Last-Modified:
|
289
|
+
- Sat, 05 Aug 2017 20:23:10 GMT
|
290
|
+
X-Oauth-Scopes:
|
291
|
+
- ''
|
292
|
+
X-Accepted-Oauth-Scopes:
|
293
|
+
- ''
|
294
|
+
X-Github-Media-Type:
|
295
|
+
- github.v3; format=json
|
296
|
+
Access-Control-Expose-Headers:
|
297
|
+
- ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
|
298
|
+
X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval,
|
299
|
+
X-GitHub-Media-Type
|
300
|
+
Access-Control-Allow-Origin:
|
301
|
+
- "*"
|
302
|
+
Strict-Transport-Security:
|
303
|
+
- max-age=31536000; includeSubdomains; preload
|
304
|
+
X-Frame-Options:
|
305
|
+
- deny
|
306
|
+
X-Content-Type-Options:
|
307
|
+
- nosniff
|
308
|
+
X-Xss-Protection:
|
309
|
+
- 1; mode=block
|
310
|
+
Referrer-Policy:
|
311
|
+
- origin-when-cross-origin, strict-origin-when-cross-origin
|
312
|
+
Content-Security-Policy:
|
313
|
+
- default-src 'none'
|
314
|
+
X-Github-Request-Id:
|
315
|
+
- 9063:4BA8:CDF93:2203B0:5CC9A444
|
316
|
+
body:
|
317
|
+
encoding: ASCII-8BIT
|
318
|
+
string: '{"sha":"3794aa1c4b76623748faf280abe5760b76823162","node_id":"MDY6Q29tbWl0NjUxMTQ0NDk6Mzc5NGFhMWM0Yjc2NjIzNzQ4ZmFmMjgwYWJlNTc2MGI3NjgyMzE2Mg==","commit":{"author":{"name":"fake
|
319
|
+
author","email":"fake@duckinator.net","date":"2017-08-05T20:23:10Z"},"committer":{"name":"fake
|
320
|
+
author","email":"fake@duckinator.net","date":"2017-08-05T20:23:10Z"},"message":"test
|
321
|
+
commit","tree":{"sha":"8286e548e330cfe01efcf7189f4df1fa53e777a7","url":"https://api.github.com/repos/how-is/example-repository/git/trees/8286e548e330cfe01efcf7189f4df1fa53e777a7"},"url":"https://api.github.com/repos/how-is/example-repository/git/commits/3794aa1c4b76623748faf280abe5760b76823162","comment_count":0,"verification":{"verified":false,"reason":"unsigned","signature":null,"payload":null}},"url":"https://api.github.com/repos/how-is/example-repository/commits/3794aa1c4b76623748faf280abe5760b76823162","html_url":"https://github.com/how-is/example-repository/commit/3794aa1c4b76623748faf280abe5760b76823162","comments_url":"https://api.github.com/repos/how-is/example-repository/commits/3794aa1c4b76623748faf280abe5760b76823162/comments","author":null,"committer":null,"parents":[{"sha":"9e29405efa433529b86722542b8fb4b34dfd9edd","url":"https://api.github.com/repos/how-is/example-repository/commits/9e29405efa433529b86722542b8fb4b34dfd9edd","html_url":"https://github.com/how-is/example-repository/commit/9e29405efa433529b86722542b8fb4b34dfd9edd"}],"stats":{"total":1,"additions":1,"deletions":0},"files":[{"sha":"a69ca6962d2a86d7c5a041338938e0b4fe6bf515","filename":"README.md","status":"modified","additions":1,"deletions":0,"changes":1,"blob_url":"https://github.com/how-is/example-repository/blob/3794aa1c4b76623748faf280abe5760b76823162/README.md","raw_url":"https://github.com/how-is/example-repository/raw/3794aa1c4b76623748faf280abe5760b76823162/README.md","contents_url":"https://api.github.com/repos/how-is/example-repository/contents/README.md?ref=3794aa1c4b76623748faf280abe5760b76823162","patch":"@@
|
322
|
+
-1,2 +1,3 @@\n # example-repository\n+\n Example repository for testing how_is."}]}'
|
323
|
+
http_version:
|
324
|
+
recorded_at: Wed, 01 May 2019 13:51:00 GMT
|
325
|
+
recorded_with: VCR 4.0.0
|
data/inq.gemspec
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'inq/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "inq"
|
9
|
+
spec.version = Inq::VERSION
|
10
|
+
spec.authors = ["Ellen Marie Dash"]
|
11
|
+
spec.email = ["me@duckie.co"]
|
12
|
+
|
13
|
+
spec.summary = %q{Quantify the health of a GitHub repository.}
|
14
|
+
spec.homepage = "https://github.com/duckinator/inq"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
# Inq only supports Ruby versions under "normal maintenance".
|
23
|
+
# This number should be updated when a Ruby version goes into security
|
24
|
+
# maintenance.
|
25
|
+
#
|
26
|
+
# Ruby maintenance info: https://www.ruby-lang.org/en/downloads/branches/
|
27
|
+
#
|
28
|
+
# NOTE: Update Gemfile when this is updated!
|
29
|
+
spec.required_ruby_version = "~> 2.4"
|
30
|
+
|
31
|
+
spec.add_runtime_dependency "github_api", "~> 0.18.1"
|
32
|
+
spec.add_runtime_dependency "okay", "~> 11.0"
|
33
|
+
|
34
|
+
spec.add_runtime_dependency "json_pure"
|
35
|
+
|
36
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
37
|
+
spec.add_development_dependency "rake", "~> 12.3"
|
38
|
+
spec.add_development_dependency "rspec", "~> 3.8"
|
39
|
+
spec.add_development_dependency "timecop", "~> 0.9.1"
|
40
|
+
spec.add_development_dependency "vcr", "~> 4.0"
|
41
|
+
spec.add_development_dependency "webmock"
|
42
|
+
# Rubocop pulls in C extensions, which we want to avoid in Windows CI.
|
43
|
+
spec.add_development_dependency "rubocop", "~> 0.68.1" unless Gem.win_platform? && ENV["CI"]
|
44
|
+
spec.add_development_dependency "github_changelog_generator"
|
45
|
+
end
|
data/lib/inq.rb
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "inq/version"
|
4
|
+
require "inq/config"
|
5
|
+
require "inq/report"
|
6
|
+
require "inq/report_collection"
|
7
|
+
|
8
|
+
##
|
9
|
+
# Top-level module for creating a report.
|
10
|
+
module Inq
|
11
|
+
def self.default_config(repository)
|
12
|
+
{
|
13
|
+
"repository" => repository,
|
14
|
+
"reports" => {
|
15
|
+
"html" => {
|
16
|
+
"directory" => ".",
|
17
|
+
"frontmatter" => {},
|
18
|
+
"filename" => "report.html",
|
19
|
+
},
|
20
|
+
},
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.new(repository, date, cache_mechanism = nil)
|
25
|
+
config =
|
26
|
+
Config.new
|
27
|
+
.load_defaults
|
28
|
+
.load(default_config(repository))
|
29
|
+
config["cache"] = {"type" => "self", "cache_mechanism" => cache_mechanism} if cache_mechanism
|
30
|
+
Report.new(config, date)
|
31
|
+
end
|
32
|
+
|
33
|
+
##
|
34
|
+
# Generates a series of report files based on a config Hash.
|
35
|
+
#
|
36
|
+
# @param config [ReportCollection] All the information needed to generate
|
37
|
+
# the reports.
|
38
|
+
# @param date [String] A string containing the date (YYYY-MM-DD) that the
|
39
|
+
# report ends on. E.g., for Jan 1-Feb 1 2017, you'd pass 2017-02-01.
|
40
|
+
def self.from_config(config, date)
|
41
|
+
raise "Expected config to be Hash, got #{config.class}" unless \
|
42
|
+
config.is_a?(Hash)
|
43
|
+
|
44
|
+
ReportCollection.new(config, date)
|
45
|
+
end
|
46
|
+
|
47
|
+
##
|
48
|
+
# Returns a list of possible export formats.
|
49
|
+
#
|
50
|
+
# @return [Array<String>] An array of the types of reports you can generate.
|
51
|
+
def self.supported_formats
|
52
|
+
["html", "json"]
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# Returns whether or not the specified +format+ is supported.
|
57
|
+
#
|
58
|
+
# @param format_name [String] The format in question.
|
59
|
+
# @return [Boolean] +true+ if HowIs supports the format, +false+ otherwise.
|
60
|
+
def self.supported_format?(format_name)
|
61
|
+
supported_formats.include?(format_name)
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "digest"
|
4
|
+
require "tmpdir"
|
5
|
+
|
6
|
+
module Inq
|
7
|
+
# Class for use in caching expensive operations
|
8
|
+
class Cacheable
|
9
|
+
def initialize(config, start_date, end_date, tmpdir = Dir.mktmpdir)
|
10
|
+
@config = config
|
11
|
+
@start_date = start_date
|
12
|
+
@end_date = end_date
|
13
|
+
@tmpdir = tmpdir
|
14
|
+
end
|
15
|
+
|
16
|
+
def cached(key, extra_digest = nil)
|
17
|
+
cache = @config["cache"]
|
18
|
+
return yield if cache.nil?
|
19
|
+
|
20
|
+
hash_key = []
|
21
|
+
hash_key << Digest::SHA1.hexdigest(extra_digest) if extra_digest
|
22
|
+
hash_key << Digest::SHA1.hexdigest(@config.to_json)
|
23
|
+
cache_key = File.join(@start_date, @end_date, key, hash_key.join("-"))
|
24
|
+
|
25
|
+
case cache["type"]
|
26
|
+
when "marshal"
|
27
|
+
MarshalCache.cached(cache_key, @tmpdir) { yield }
|
28
|
+
when "self"
|
29
|
+
# Can provide your own cache in Inq.new
|
30
|
+
# e.g.
|
31
|
+
# cache_mechanism = ->(cache_key, config, block) do
|
32
|
+
# if cached?
|
33
|
+
# cached_value
|
34
|
+
# else
|
35
|
+
# block.call
|
36
|
+
# end
|
37
|
+
# end
|
38
|
+
# Inq.new("owner/repo", date, cache_mechanism)
|
39
|
+
cache["cache_mechanism"].call(cache_key, @config, ->() { yield })
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# This is only okay on a local system
|
44
|
+
module MarshalCache
|
45
|
+
class << self
|
46
|
+
# rubocop:disable Security/MarshalLoad
|
47
|
+
def cached(key, tmpdir)
|
48
|
+
require "fileutils"
|
49
|
+
|
50
|
+
path = File.join(tmpdir, "inq", key)
|
51
|
+
FileUtils.mkdir_p(File.dirname(path))
|
52
|
+
|
53
|
+
ret = nil
|
54
|
+
if File.exist?(path)
|
55
|
+
File.open(path, "rb") do |f|
|
56
|
+
ret = Marshal.load(f)
|
57
|
+
end
|
58
|
+
ret
|
59
|
+
else
|
60
|
+
ret = yield
|
61
|
+
File.open(path, "wb") do |file|
|
62
|
+
Marshal.dump(ret, file)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
ret
|
66
|
+
end
|
67
|
+
# rubocop:enable Security/MarshalLoad
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|