gemlens 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: 7e74316581d6c5d398840ca97854991e86a18a84f6e24ff8ac17e060e2878371
4
+ data.tar.gz: d1224fa3378a9f4bf11800f3c9ed11cfa9f3a0a2002ca0dc92005f5fb1fbb8a8
5
+ SHA512:
6
+ metadata.gz: b80c10dcf884caf541e832d7a36a6a1a4bf5921e4b6893a8f10b6c7ff61c1f19aceb5c421049d4cc20cf5ebb92d2c37fe63d2461cd5d77a848a0494d2500149e
7
+ data.tar.gz: 26fd74d4b129cc45acb4c2454ebcc19232af7fae38e519c8ce7cf316c5ed66c32869447c9c7edcf01f23e5b6cc20be813b3d0c262b23d74357d0d061e2277354
@@ -0,0 +1,18 @@
1
+ name: Ruby
2
+
3
+ on: [push,pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: 3.0.0
14
+ - name: Run the default task
15
+ run: |
16
+ gem install bundler -v 2.2.3
17
+ bundle install
18
+ bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ *.gem
data/.rubocop.yml ADDED
@@ -0,0 +1,10 @@
1
+ Style/StringLiterals:
2
+ Enabled: true
3
+ EnforcedStyle: double_quotes
4
+
5
+ Style/StringLiteralsInInterpolation:
6
+ Enabled: true
7
+ EnforcedStyle: double_quotes
8
+
9
+ Layout/LineLength:
10
+ Max: 120
data/1git ADDED
@@ -0,0 +1,6 @@
1
+ fatal: ambiguous argument 'log': unknown revision or path not in the working tree.
2
+ Use '--' to separate paths from revisions, like this:
3
+ 'git <command> [<revision>...] -- [<file>...]'
4
+ fatal: ambiguous argument 'log': unknown revision or path not in the working tree.
5
+ Use '--' to separate paths from revisions, like this:
6
+ 'git <command> [<revision>...] -- [<file>...]'
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at wongwf82@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in gemlens.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rubocop", "~> 0.80"
data/Gemfile.lock ADDED
@@ -0,0 +1,46 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ gemlens (0.1.0)
5
+ colorize (~> 1.1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.3)
11
+ colorize (1.1.0)
12
+ parallel (1.27.0)
13
+ parser (3.3.8.0)
14
+ ast (~> 2.4.1)
15
+ racc
16
+ prism (1.4.0)
17
+ racc (1.8.1)
18
+ rainbow (3.1.1)
19
+ rake (13.3.0)
20
+ regexp_parser (2.10.0)
21
+ rexml (3.4.1)
22
+ rubocop (0.93.1)
23
+ parallel (~> 1.10)
24
+ parser (>= 2.7.1.5)
25
+ rainbow (>= 2.2.2, < 4.0)
26
+ regexp_parser (>= 1.8)
27
+ rexml
28
+ rubocop-ast (>= 0.6.0)
29
+ ruby-progressbar (~> 1.7)
30
+ unicode-display_width (>= 1.4.0, < 2.0)
31
+ rubocop-ast (1.45.1)
32
+ parser (>= 3.3.7.2)
33
+ prism (~> 1.4)
34
+ ruby-progressbar (1.13.0)
35
+ unicode-display_width (1.8.0)
36
+
37
+ PLATFORMS
38
+ arm64-darwin-23
39
+
40
+ DEPENDENCIES
41
+ gemlens!
42
+ rake (~> 13.0)
43
+ rubocop (~> 0.80)
44
+
45
+ BUNDLED WITH
46
+ 2.2.3
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Fai Wong
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # GemLens
2
+
3
+ **Gemlens** is a CLI tool to analyze the evolution of your `Gemfile` over time. It helps you track when gems were added, removed, or updated in a project β€” great for audits, debugging, or historical exploration.
4
+
5
+ ---
6
+
7
+ ## ✨ Features
8
+
9
+ - Track changes to gems across Git commits
10
+ - View added, removed, or updated gems with commit metadata
11
+ - Colorized timeline output for clarity
12
+ - Works on any Git-tracked Ruby project
13
+
14
+ ---
15
+
16
+ ## 🧰 Installation
17
+
18
+ Add this line to your application's Gemfile:
19
+
20
+ ```ruby
21
+ gem 'gemlens'
22
+ ```
23
+
24
+ Then execute:
25
+
26
+ ```sh
27
+ $ bundle install
28
+ ```
29
+
30
+ Or install it globally:
31
+
32
+ ```sh
33
+ $ gem install gemlens
34
+ ```
35
+
36
+ ---
37
+
38
+ ## πŸš€ Usage
39
+
40
+ From any Git-tracked Ruby project:
41
+
42
+ ```sh
43
+ $ bundle exec gemlens
44
+ ```
45
+
46
+ You’ll get a timeline showing how your `Gemfile` has changed, for example:
47
+
48
+ ```
49
+ πŸ“œ Gemfile History Timeline
50
+
51
+ 🟩 2023-04-11 Added pry by Jane Doe ➜ PR #1234 | Add pry for debugging
52
+ πŸŸ₯ 2023-05-09 Removed byebug by Jane Doe ➜ 4d3c1f0 | Remove unused gem
53
+ 🟦 2023-06-12 Updated rails (6.1.0 β†’ 7.0.4) by John Smith ➜ PR #2345 | Upgrade Rails
54
+ ```
55
+
56
+ You can also pass a path to another repo:
57
+
58
+ ```sh
59
+ $ bundle exec gemlens /path/to/another/repo
60
+ ```
61
+
62
+ ---
63
+
64
+ ## πŸ”§ Development
65
+
66
+ To set up the project locally:
67
+
68
+ ```sh
69
+ $ git clone https://github.com/BestBitsLab/gemlens.git
70
+ $ cd gemlens
71
+ $ bin/setup
72
+ ```
73
+
74
+ You can experiment with the code via:
75
+
76
+ ```sh
77
+ $ bin/console
78
+ ```
79
+
80
+ To build and install the gem locally:
81
+
82
+ ```sh
83
+ $ bundle exec rake install
84
+ ```
85
+
86
+ To release a new version:
87
+
88
+ 1. Update the version in `lib/gemlens/version.rb`
89
+ 2. Run:
90
+
91
+ ```sh
92
+ $ bundle exec rake release
93
+ ```
94
+
95
+ This will tag, push, and publish to [RubyGems.org](https://rubygems.org).
96
+
97
+ ---
98
+
99
+ ## 🀝 Contributing
100
+
101
+ Bug reports and pull requests are welcome on [GitHub](https://github.com/BestBitsLab/gemlens). This project is intended to be a safe, welcoming space for collaboration. Please read and follow the [code of conduct](https://github.com/BestBitsLab/gemlens/blob/main/CODE_OF_CONDUCT.md).
102
+
103
+ ---
104
+
105
+ ## πŸͺͺ License
106
+
107
+ This gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
108
+
109
+ ---
110
+
111
+ ## πŸ“œ Code of Conduct
112
+
113
+ Everyone interacting in the Gemlens project’s codebase, issue trackers, and other community spaces is expected to follow the [Code of Conduct](https://github.com/BestBitsLab/gemlens/blob/main/CODE_OF_CONDUCT.md).
114
+
115
+ ---
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rubocop/rake_task"
5
+
6
+ RuboCop::RakeTask.new
7
+
8
+ task default: :rubocop
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "gemlens"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/gemlens ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "gemlens"
5
+
6
+ Gemlens.run(ARGV[0] || ".")
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/gemlens.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/gemlens/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "gemlens"
7
+ s.version = Gemlens::VERSION
8
+ s.authors = ["Fai Wong"]
9
+ s.email = ["wongwf82@gmail.com"]
10
+
11
+ s.summary = "Track and visualize changes to your Gemfile over time."
12
+ s.description = "GemLens is a developer tool that analyzes the history of your Gemfile using Git and presents a timeline of gem additions, removals, and version updates. It's useful for auditing dependency changes, generating changelogs, and understanding how your project's gem dependencies evolved. Built for maintainers, teams, and curious developers."
13
+ s.license = "MIT"
14
+ s.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
15
+
16
+ s.homepage = "https://github.com/BestBitsLab/gemlens"
17
+ s.metadata["source_code_uri"] = "https://github.com/BestBitsLab/gemlens"
18
+
19
+ # Specify which files should be added to the gem when it is released.
20
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
+ s.files = Dir.chdir(File.expand_path(__dir__)) do
22
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
23
+ end
24
+ s.bindir = "bin"
25
+ s.executables = s.files.grep(%r{\Abin/}) { |f| File.basename(f) }
26
+ s.require_paths = ["lib"]
27
+
28
+ s.add_dependency "colorize", "~> 1.1.0"
29
+ end