Skip to content

Commit

Permalink
chore: tidy up repo
Browse files Browse the repository at this point in the history
  • Loading branch information
3v0k4 committed Dec 4, 2024
1 parent a741196 commit dcc6687
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 28 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ruby
name: Test

on:
push:
Expand All @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
ruby:
- '3.3.6'
- 3.3

steps:
- uses: actions/checkout@v4
Expand All @@ -23,5 +23,4 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task
run: bundle exec rake
- run: bin/rake test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
/pkg/
/spec/reports/
/tmp/

.DS_Store
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
require:
- rubocop-minitest
- rubocop-performance
- rubocop-rake
- rubocop-thread_safety

AllCops:
TargetRubyVersion: 3.1
NewCops: enable

Style/StringLiterals:
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes

Layout/LineLength:
Max: 120
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## [Unreleased]

## [0.1.0] - 2024-11-19
## [0.1.0]

- Initial release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<p></p>

Find unused gems in your bundle (ie, an app with a `Gemfile` or a gem with both a `Gemfile` and a gemspec).
Find unused gems in the Ruby bundle (ie, an app with a `Gemfile` or a gem with both a `Gemfile` and a gemspec).

Notice that, given the dynamic nature of Ruby, it's not possible to identify unused gems with confidence.

Expand Down
23 changes: 7 additions & 16 deletions degem.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,17 @@ Gem::Specification.new do |spec|
spec.authors = ["3v0k4"]
spec.email = ["[email protected]"]

spec.summary = "Write a short summary, because RubyGems requires one."
spec.description = "Write a longer description or delete this line."
spec.homepage = "http://example.com"
spec.summary = "Find unused gems in the Ruby bundle"
spec.description = "Degem finds unused gems in the Ruby bundle (ie, an app with a `Gemfile` or a gem with both a `Gemfile` and a gemspec)."
spec.homepage = "https://github.com/3v0k4/degem"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.1.0"

spec.metadata["allowed_push_host"] = "http://example.com"

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "http://example.com"
spec.metadata["changelog_uri"] = "http://example.com"
spec.metadata["source_code_uri"] = spec.homepage
spec.metadata["changelog_uri"] = "https://github.com/3v0k4/favicon_factory/blob/main/CHANGELOG.md"

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
gemspec = File.basename(__FILE__)
spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
ls.readlines("\x0", chomp: true).reject do |f|
(f == gemspec) ||
f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
end
end
spec.files = Dir.glob("lib/**/*") + Dir.glob("exe/*")
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
Expand All @@ -38,4 +28,5 @@ Gem::Specification.new do |spec|

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
spec.metadata["rubygems_mfa_required"] = "true"
end
4 changes: 0 additions & 4 deletions sig/degem.rbs

This file was deleted.

6 changes: 4 additions & 2 deletions test/test_degem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -684,18 +684,20 @@ def test_e2e__it_prints_unused_gems

Bundler.with_unbundled_env do
Dir.chdir(GEM_DIR) do
Open3.capture3("bundle gem myapp") unless skip
Open3.capture3("bundle gem myapp --test=minitest") unless skip

Dir.chdir(File.join(GEM_DIR, "myapp")) do
Open3.capture3("bundle config set --local path vendor") unless skip
Open3.capture3("bundle install") unless skip
Open3.capture3("git config --global user.email '[email protected]'")
Open3.capture3("git config --global user.name 'name'")
Open3.capture3("git commit --all -m 'init'") unless skip
Open3.capture3("bundle add favicon_factory") unless skip
Open3.capture3("git commit --all -m 'add favicon_factory'") unless skip
Open3.capture3("bundle add --path '../../..' degem") unless skip
Open3.capture3('echo \'require "rubocop"\' >> lib/myapp.rb') unless skip

out, err, status = Open3.capture3("bundle exec degem Gemfile")
_out, err, status = Open3.capture3("bundle exec degem Gemfile")

assert_equal 0, status.exitstatus
refute_includes err, "myapp" # required in tests
Expand Down

0 comments on commit dcc6687

Please sign in to comment.