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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4f29850531cd95147f1f6c98b63ac4e2308568d3a3e949ecb6f30d6e9f22444
4
- data.tar.gz: 14a0e59f5e86a739786521b4cd42c1a8fc0e90809624a8d4dd6d9d7ada0ba478
3
+ metadata.gz: 20067335d58faf7ad283747517c6c5d4834c7ac15d0aa8d049d1cfd9c037a00b
4
+ data.tar.gz: 573f32638418613e748fcd01860f9757cfbdfe847c4b764d2da3bb2c8a8f9c64
5
5
  SHA512:
6
- metadata.gz: 0c213737148a7fb1859878f0647199ddfa78e9cd16fac70540632b343bba6130574c33cff5735a4426d396408e8c013e4f1acccd02e8ac0a5e2f43ef0eeaf16f
7
- data.tar.gz: 517e34220cc9afe3a90fd89691b8779ec686ca3bdc331ec527232cc98a3dcd9b05f5f69755a1163fa0d0e7d28273b1f42af64ca60a48e23b30b47824caddb432
6
+ metadata.gz: c2ac1203bfae2b86d4b1f83aba7ca2a773f8f1ace7937a5fc823ec587c3636fc992a208198f54504d17102c1d33c33ecebb0fe89fef7ccb0223b406877fc8b7b
7
+ data.tar.gz: 0a61e75f18fb018d22eb031523d3c0e05e16e2250880915e365f7e1cff0e545a49dcce28b708d7a0eaebe8856c7eb490e12161833b30ce5100f95f37611b38ea
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # GitFollow
2
2
 
3
+ [![Gem Version](https://img.shields.io/gem/v/gitfollow?logo=ruby&color=CC342D)](https://rubygems.org/gems/gitfollow)
4
+ [![Daily Follower Check](https://github.com/Bulletdev/GitFollow/actions/workflows/daily-check.yml/badge.svg)](https://github.com/Bulletdev/GitFollow/actions/workflows/daily-check.yml)
3
5
  [![CI](https://github.com/bulletdev/gitfollow/workflows/CI/badge.svg)](https://github.com/bulletdev/gitfollow/actions)
4
- [![Ruby Version](https://img.shields.io/badge/ruby-%3E%3D%203.0-ruby.svg)](https://www.ruby-lang.org)
5
- [![Gem Version](https://badge.fury.io/rb/gitfollow.svg)](https://badge.fury.io/rb/gitfollow)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  [![codecov](https://codecov.io/gh/bulletdev/gitfollow/branch/main/graph/badge.svg)](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[:username]}"
31
- puts "Followers: #{snapshot[:stats][:followers_count]}"
32
- puts "Following: #{snapshot[:stats][:following_count]}"
33
- puts "Mutual: #{snapshot[:stats][:mutual_count]}"
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
 
@@ -7,7 +7,9 @@ module GitFollow
7
7
  attr_reader :username, :client
8
8
 
9
9
  def initialize(token:, username: nil)
10
- raise ArgumentError, 'GitHub token is required' if token.nil? || token.empty?
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitFollow
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitfollow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael D. Bullet