Class: Degem::FindUnused
- Inherits:
-
Object
- Object
- Degem::FindUnused
- Defined in:
- lib/degem/find_unused.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(gemfile_path:, gem_specification: Gem::Specification, bundle_paths: GitLsFiles.new) ⇒ FindUnused
constructor
A new instance of FindUnused.
Constructor Details
#initialize(gemfile_path:, gem_specification: Gem::Specification, bundle_paths: GitLsFiles.new) ⇒ FindUnused
Returns a new instance of FindUnused.
5 6 7 8 9 10 |
# File 'lib/degem/find_unused.rb', line 5 def initialize(gemfile_path:, gem_specification: Gem::Specification, bundle_paths: GitLsFiles.new) @gemfile_path = gemfile_path @gem_specification = gem_specification fallback = Dir.glob(File.join(File.dirname(gemfile_path), "**/*.rb")) @bundle_paths = bundle_paths.call(fallback) end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 |
# File 'lib/degem/find_unused.rb', line 12 def call rubygems = gemfile.rubygems.reject { _1.name == "degem" } rubygems = reject_railties(rubygems) if gemfile.rails? reject_used(rubygems) end |