gitfollow 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/README.md +2 -2
- data/lib/gitfollow/cli.rb +10 -7
- data/lib/gitfollow/client.rb +3 -1
- data/lib/gitfollow/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 20067335d58faf7ad283747517c6c5d4834c7ac15d0aa8d049d1cfd9c037a00b
|
|
4
|
+
data.tar.gz: 573f32638418613e748fcd01860f9757cfbdfe847c4b764d2da3bb2c8a8f9c64
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2ac1203bfae2b86d4b1f83aba7ca2a773f8f1ace7937a5fc823ec587c3636fc992a208198f54504d17102c1d33c33ecebb0fe89fef7ccb0223b406877fc8b7b
|
|
7
|
+
data.tar.gz: 0a61e75f18fb018d22eb031523d3c0e05e16e2250880915e365f7e1cff0e545a49dcce28b708d7a0eaebe8856c7eb490e12161833b30ce5100f95f37611b38ea
|
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# GitFollow
|
|
2
2
|
|
|
3
|
+
[](https://rubygems.org/gems/gitfollow)
|
|
4
|
+
[](https://github.com/Bulletdev/GitFollow/actions/workflows/daily-check.yml)
|
|
3
5
|
[](https://github.com/bulletdev/gitfollow/actions)
|
|
4
|
-
[](https://www.ruby-lang.org)
|
|
5
|
-
[](https://badge.fury.io/rb/gitfollow)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
[](https://codecov.io/gh/bulletdev/gitfollow)
|
|
8
8
|
|
data/lib/gitfollow/cli.rb
CHANGED
|
@@ -27,10 +27,10 @@ module GitFollow
|
|
|
27
27
|
spinner.success('Done!')
|
|
28
28
|
|
|
29
29
|
puts "\nInitialization complete!"
|
|
30
|
-
puts "Username: @#{snapshot[
|
|
31
|
-
puts "Followers: #{snapshot[
|
|
32
|
-
puts "Following: #{snapshot[
|
|
33
|
-
puts "Mutual: #{snapshot[
|
|
30
|
+
puts "Username: @#{snapshot['username']}"
|
|
31
|
+
puts "Followers: #{snapshot['stats']['followers_count']}"
|
|
32
|
+
puts "Following: #{snapshot['stats']['following_count']}"
|
|
33
|
+
puts "Mutual: #{snapshot['stats']['mutual_count']}"
|
|
34
34
|
puts "\nRun 'gitfollow check' to detect changes."
|
|
35
35
|
rescue StandardError => e
|
|
36
36
|
spinner.error("Failed: #{e.message}")
|
|
@@ -224,9 +224,10 @@ module GitFollow
|
|
|
224
224
|
def setup_components
|
|
225
225
|
token = options[:token] || ENV.fetch('OCTOCAT_TOKEN', nil)
|
|
226
226
|
|
|
227
|
-
if token.nil? || token.empty?
|
|
228
|
-
puts 'Error: GitHub token not provided.'
|
|
227
|
+
if token.nil? || token.empty? || token.strip.empty?
|
|
228
|
+
puts 'Error: GitHub token not provided or is empty.'
|
|
229
229
|
puts 'Set OCTOCAT_TOKEN environment variable or use --token option.'
|
|
230
|
+
puts 'Get a token at: https://github.com/settings/tokens'
|
|
230
231
|
exit 1
|
|
231
232
|
end
|
|
232
233
|
|
|
@@ -234,7 +235,9 @@ module GitFollow
|
|
|
234
235
|
@client = GitFollow::Client.new(token: token)
|
|
235
236
|
|
|
236
237
|
unless @client.valid_token?
|
|
237
|
-
puts 'Error: Invalid GitHub token.'
|
|
238
|
+
puts 'Error: Invalid GitHub token or insufficient permissions.'
|
|
239
|
+
puts 'Ensure your token has the following scopes: read:user, user:follow'
|
|
240
|
+
puts 'Generate a new token at: https://github.com/settings/tokens'
|
|
238
241
|
exit 1
|
|
239
242
|
end
|
|
240
243
|
|
data/lib/gitfollow/client.rb
CHANGED
|
@@ -7,7 +7,9 @@ module GitFollow
|
|
|
7
7
|
attr_reader :username, :client
|
|
8
8
|
|
|
9
9
|
def initialize(token:, username: nil)
|
|
10
|
-
|
|
10
|
+
if token.nil? || token.empty? || token.strip.empty?
|
|
11
|
+
raise ArgumentError, 'GitHub token is required and cannot be empty'
|
|
12
|
+
end
|
|
11
13
|
|
|
12
14
|
@client = Octokit::Client.new(access_token: token)
|
|
13
15
|
@client.auto_paginate = true
|
data/lib/gitfollow/version.rb
CHANGED