gitfollow 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b4f29850531cd95147f1f6c98b63ac4e2308568d3a3e949ecb6f30d6e9f22444
4
+ data.tar.gz: 14a0e59f5e86a739786521b4cd42c1a8fc0e90809624a8d4dd6d9d7ada0ba478
5
+ SHA512:
6
+ metadata.gz: 0c213737148a7fb1859878f0647199ddfa78e9cd16fac70540632b343bba6130574c33cff5735a4426d396408e8c013e4f1acccd02e8ac0a5e2f43ef0eeaf16f
7
+ data.tar.gz: 517e34220cc9afe3a90fd89691b8779ec686ca3bdc331ec527232cc98a3dcd9b05f5f69755a1163fa0d0e7d28273b1f42af64ca60a48e23b30b47824caddb432
data/CHANGELOG.md ADDED
@@ -0,0 +1,55 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2025-10-07
11
+
12
+ ### Added
13
+ - Initial release of GitFollow
14
+ - Track GitHub followers and unfollows
15
+ - Detect new followers automatically
16
+ - Detect unfollows automatically
17
+ - Store follower history with timestamps
18
+ - Generate detailed reports (text and markdown)
19
+ - Display follower statistics
20
+ - List mutual followers
21
+ - List non-followers (users you follow who don't follow back)
22
+ - Export data to JSON format
23
+ - Export data to CSV format
24
+ - Create GitHub Issues automatically on changes
25
+ - Colorized terminal output
26
+ - Formatted table output with TTY::Table
27
+ - Progress spinners for API calls
28
+ - JSON output mode for all commands
29
+ - CLI commands:
30
+ - `gitfollow init` - Initialize and create first snapshot
31
+ - `gitfollow check` - Check for follower changes
32
+ - `gitfollow report` - Generate detailed report
33
+ - `gitfollow stats` - Display statistics
34
+ - `gitfollow mutual` - List mutual followers
35
+ - `gitfollow non-followers` - List non-followers
36
+ - `gitfollow export` - Export data
37
+ - `gitfollow clear` - Clear all stored data
38
+ - `gitfollow version` - Display version
39
+ - GitHub Actions workflows:
40
+ - CI workflow with tests and linting
41
+ - Daily follower check workflow
42
+ - Automated release workflow
43
+ - Comprehensive test suite with RSpec
44
+ - RuboCop configuration for code quality
45
+ - Support for Ruby 3.0, 3.1, 3.2, and 3.3
46
+ - MIT License
47
+ - Complete documentation
48
+
49
+ ### Security
50
+ - GitHub token authentication
51
+ - Rate limit aware API calls
52
+ - No credentials stored in data files
53
+
54
+ [Unreleased]: https://github.com/bulletdev/gitfollow/compare/v0.1.0...HEAD
55
+ [0.1.0]: https://github.com/bulletdev/gitfollow/releases/tag/v0.1.0
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Michael D. Bullet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,437 @@
1
+ # GitFollow
2
+
3
+ [![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
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![codecov](https://codecov.io/gh/bulletdev/gitfollow/branch/main/graph/badge.svg)](https://codecov.io/gh/bulletdev/gitfollow)
8
+
9
+ **GitFollow** is a powerful CLI tool to track your GitHub followers and unfollows with ease. Get notified when someone follows or unfollows you, generate detailed reports, and automate your follower monitoring with GitHub Actions.
10
+
11
+ ## Features
12
+
13
+ **Core Features**
14
+ - 🔍 Track new followers in real-time
15
+ - Detect unfollows automatically
16
+ - Generate detailed statistics and reports
17
+ - Maintain complete history with timestamps
18
+ - Create GitHub Issues automatically on changes
19
+ - Local JSON-based storage
20
+
21
+ **Beautiful Output**
22
+ - Colorized terminal output
23
+ - Formatted tables (TTY::Table)
24
+ - Progress spinners
25
+ - Markdown and plain text reports
26
+
27
+ **Developer-Friendly**
28
+ - JSON export support
29
+ - CSV export for data analysis
30
+ - Configurable data directory
31
+ - Rate limit aware
32
+ - Comprehensive error handling
33
+
34
+ ## Installation
35
+
36
+ ### Via RubyGems (Recommended)
37
+
38
+ ```bash
39
+ gem install gitfollow
40
+ ```
41
+
42
+ ### From Source
43
+
44
+ ```bash
45
+ git clone https://github.com/bulletdev/gitfollow.git
46
+ cd gitfollow
47
+ bundle install
48
+ gem build gitfollow.gemspec
49
+ gem install ./gitfollow-0.1.0.gem
50
+ ```
51
+
52
+ ## Configuration
53
+
54
+ ### GitHub Token
55
+
56
+ GitFollow requires a GitHub Personal Access Token with appropriate permissions.
57
+
58
+ 1. **Generate a token**: Go to [GitHub Settings → Developer settings → Personal access tokens](https://github.com/settings/tokens)
59
+ 2. **Required scopes**: `read:user` (to read your follower data)
60
+ 3. **Set the token**:
61
+
62
+ ```bash
63
+ export OCTOCAT_TOKEN="your_github_token_here"
64
+ ```
65
+
66
+ Or create a `.env` file:
67
+
68
+ ```bash
69
+ OCTOCAT_TOKEN=your_github_token_here
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ ### Initialize GitFollow
75
+
76
+ First, initialize GitFollow to create your first snapshot:
77
+
78
+ ```bash
79
+ gitfollow init
80
+ ```
81
+
82
+ **Output:**
83
+ ```
84
+ ✔ Fetching initial data... Done!
85
+
86
+ Initialization complete!
87
+ Username: @yourname
88
+ Followers: 542
89
+ Following: 123
90
+ Mutual: 89
91
+
92
+ Run 'gitfollow check' to detect changes.
93
+ ```
94
+
95
+ ### Check for Changes
96
+
97
+ Check for new followers or unfollows:
98
+
99
+ ```bash
100
+ gitfollow check
101
+ ```
102
+
103
+ **Output:**
104
+ ```
105
+ ✔ Checking for changes... Done!
106
+
107
+ Changes detected for @yourname
108
+
109
+ ✅ New Followers (2):
110
+ • @newuser1
111
+ • @newuser2
112
+
113
+ ❌ Unfollowed (1):
114
+ • @olduser
115
+
116
+ Net change: +1
117
+ Previous: 542 → Current: 543
118
+ ```
119
+
120
+ ### Display Statistics
121
+
122
+ View your current follower statistics:
123
+
124
+ ```bash
125
+ gitfollow stats
126
+ ```
127
+
128
+ **Output:**
129
+ ```
130
+ Follower Statistics for @yourname
131
+ ==================================================
132
+ ┌──────────────────────┬─────┐
133
+ │Followers │543 │
134
+ │Following │123 │
135
+ │Mutual │89 │
136
+ │Ratio │4.41 │
137
+ │Total New Followers │15 │
138
+ │Total Unfollows │3 │
139
+ └──────────────────────┴─────┘
140
+
141
+ Last Updated: 2025-10-07 09:00:00 UTC
142
+ ```
143
+
144
+ ### Generate Reports
145
+
146
+ Generate a detailed report:
147
+
148
+ ```bash
149
+ # Plain text report
150
+ gitfollow report
151
+
152
+ # Markdown report
153
+ gitfollow report --format=markdown
154
+
155
+ # Save to file
156
+ gitfollow report --format=markdown --output=report.md
157
+ ```
158
+
159
+ ### Find Mutual Followers
160
+
161
+ List users who follow you and whom you follow back:
162
+
163
+ ```bash
164
+ gitfollow mutual
165
+ ```
166
+
167
+ ### Find Non-Followers
168
+
169
+ List users you follow who don't follow you back:
170
+
171
+ ```bash
172
+ gitfollow non-followers
173
+ ```
174
+
175
+ ### Export Data
176
+
177
+ Export your data for analysis:
178
+
179
+ ```bash
180
+ # Export to JSON
181
+ gitfollow export json data.json
182
+
183
+ # Export to CSV
184
+ gitfollow export csv data.csv
185
+ ```
186
+
187
+ ## Advanced Usage
188
+
189
+ ### JSON Output
190
+
191
+ All commands support JSON output:
192
+
193
+ ```bash
194
+ gitfollow check --json
195
+ gitfollow stats --json
196
+ gitfollow mutual --json
197
+ ```
198
+
199
+ ### Table Format
200
+
201
+ Display changes in a formatted table:
202
+
203
+ ```bash
204
+ gitfollow check --table
205
+ ```
206
+
207
+ ### Quiet Mode
208
+
209
+ Suppress output if no changes detected:
210
+
211
+ ```bash
212
+ gitfollow check --quiet
213
+ ```
214
+
215
+ ### Custom Data Directory
216
+
217
+ Store data in a custom location:
218
+
219
+ ```bash
220
+ gitfollow check --data-dir=/path/to/data
221
+ ```
222
+
223
+ ### Create GitHub Issues on Changes
224
+
225
+ Automatically create an issue when changes are detected:
226
+
227
+ ```bash
228
+ gitfollow check --notify="bulletdev/gitfollow"
229
+ ```
230
+
231
+ ## Automated Monitoring with GitHub Actions
232
+
233
+ Set up automated daily checks using GitHub Actions:
234
+
235
+ ### 1. Create Workflow File
236
+
237
+ Create `.github/workflows/daily-check.yml`:
238
+
239
+ ```yaml
240
+ name: Daily Follower Check
241
+
242
+ on:
243
+ schedule:
244
+ - cron: '0 9 * * *' # Run daily at 9 AM UTC
245
+ workflow_dispatch:
246
+
247
+ jobs:
248
+ check-followers:
249
+ runs-on: ubuntu-latest
250
+ steps:
251
+ - uses: actions/checkout@v4
252
+
253
+ - uses: ruby/setup-ruby@v1
254
+ with:
255
+ ruby-version: '3.3'
256
+
257
+ - name: Install GitFollow
258
+ run: gem install gitfollow
259
+
260
+ - name: Cache data
261
+ uses: actions/cache@v4
262
+ with:
263
+ path: ~/.gitfollow
264
+ key: gitfollow-data
265
+
266
+ - name: Check followers
267
+ env:
268
+ OCTOCAT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
269
+ run: |
270
+ gitfollow init || true
271
+ gitfollow check --notify="${{ github.repository }}"
272
+ ```
273
+
274
+ ### 2. Enable Workflow
275
+
276
+ 1. Push the workflow file to your repository
277
+ 2. Go to **Actions** tab in your repository
278
+ 3. Enable the workflow
279
+ 4. It will run automatically every day!
280
+
281
+ ## CLI Commands Reference
282
+
283
+ | Command | Description |
284
+ |---------|-------------|
285
+ | `gitfollow init` | Initialize and create first snapshot |
286
+ | `gitfollow check` | Check for follower changes |
287
+ | `gitfollow report` | Generate detailed report |
288
+ | `gitfollow stats` | Display statistics |
289
+ | `gitfollow mutual` | List mutual followers |
290
+ | `gitfollow non-followers` | List non-followers |
291
+ | `gitfollow export FORMAT FILE` | Export data (json/csv) |
292
+ | `gitfollow clear` | Clear all stored data |
293
+ | `gitfollow version` | Display version |
294
+
295
+ ## Configuration File
296
+
297
+ You can create a `.gitfollow.yml` config file (optional):
298
+
299
+ ```yaml
300
+ # Custom data directory
301
+ data_dir: ~/.gitfollow
302
+
303
+ # Default notification repository
304
+ notify_repo: bulletdev/gitfollow
305
+
306
+ # Output preferences
307
+ output:
308
+ colorize: true
309
+ format: table
310
+ ```
311
+
312
+ ## Data Storage
313
+
314
+ GitFollow stores data in `~/.gitfollow/` by default:
315
+
316
+ ```
317
+ ~/.gitfollow/
318
+ ├── snapshots.json # Follower snapshots
319
+ └── history.json # Change history
320
+ ```
321
+
322
+ ## Development
323
+
324
+ ### Setup
325
+
326
+ ```bash
327
+ git clone https://github.com/bulletdev/gitfollow.git
328
+ cd gitfollow
329
+ bundle install
330
+ ```
331
+
332
+ ### Run Tests
333
+
334
+ ```bash
335
+ bundle exec rspec
336
+ ```
337
+
338
+ ### Lint Code
339
+
340
+ ```bash
341
+ bundle exec rubocop
342
+ ```
343
+
344
+ ### Build Gem
345
+
346
+ ```bash
347
+ gem build gitfollow.gemspec
348
+ ```
349
+
350
+ ## Contributing
351
+
352
+ Contributions are welcome! Please follow these steps:
353
+
354
+ 1. Fork the repository
355
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
356
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
357
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
358
+ 5. Open a Pull Request
359
+
360
+ Please ensure:
361
+ - All tests pass (`bundle exec rspec`)
362
+ - Code follows style guide (`bundle exec rubocop`)
363
+ - Add tests for new features
364
+ - Update documentation as needed
365
+
366
+ ## Publishing to RubyGems
367
+
368
+ ### Manual Publication
369
+
370
+ ```bash
371
+ # Build the gem
372
+ gem build gitfollow.gemspec
373
+
374
+ # Push to RubyGems
375
+ gem push gitfollow-0.1.0.gem
376
+ ```
377
+
378
+ ### Automated Release
379
+
380
+ 1. Update version in `lib/gitfollow/version.rb`
381
+ 2. Update `CHANGELOG.md`
382
+ 3. Commit changes
383
+ 4. Create and push a tag:
384
+
385
+ ```bash
386
+ git tag v0.1.0
387
+ git push origin v0.1.0
388
+ ```
389
+
390
+ The GitHub Actions workflow will automatically build and publish to RubyGems.
391
+
392
+ ## Troubleshooting
393
+
394
+ ### Authentication Failed
395
+
396
+ **Error:** `Authentication failed while fetching followers`
397
+
398
+ **Solution:** Ensure your GitHub token is valid and has the required `read:user` scope.
399
+
400
+ ### Rate Limit Exceeded
401
+
402
+ **Error:** `Rate limit exceeded`
403
+
404
+ **Solution:** GitHub API has rate limits. Wait for the limit to reset or reduce check frequency.
405
+
406
+ ### No Changes Detected on First Run
407
+
408
+ This is expected! Run `gitfollow init` first to create your initial snapshot.
409
+
410
+ ## Security
411
+
412
+ - Never commit your GitHub token to version control
413
+ - Use GitHub Secrets for CI/CD workflows
414
+ - The `.env` file should be in `.gitignore`
415
+ - Tokens are never logged or stored in data files
416
+
417
+ ## License
418
+
419
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
420
+
421
+ ## Acknowledgments
422
+
423
+ - Built with [Octokit](https://github.com/octokit/octokit.rb) for GitHub API
424
+ - Uses [Thor](https://github.com/rails/thor) for CLI framework
425
+ - Formatted output with [TTY::Table](https://github.com/piotrmurach/tty-table)
426
+
427
+ ## Support
428
+
429
+ - 🐛 [Report a bug](https://github.com/bulletdev/gitfollow/issues)
430
+ - 💡 [Request a feature](https://github.com/bulletdev/gitfollow/issues)
431
+ - 📖 [Documentation](https://github.com/bulletdev/gitfollow/blob/main/README.md)
432
+
433
+ ---
434
+
435
+ **Made with 💎♦️ by [Michael D. Bullet](https://github.com/bulletdev)**
436
+
437
+ ⭐ Star this repo if you find it useful!
data/bin/gitfollow ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative '../lib/gitfollow'
5
+
6
+ begin
7
+ GitFollow::CLI.start(ARGV)
8
+ rescue Interrupt
9
+ puts "\nInterrupted. Exiting..."
10
+ exit 130
11
+ rescue StandardError => e
12
+ warn "Error: #{e.message}"
13
+ warn e.backtrace.join("\n") if ENV['DEBUG']
14
+ exit 1
15
+ end