Class: Degem::DecorateUnusedGems

Inherits:
Object
  • Object
show all
Defined in:
lib/degem/decorate_unused_gems.rb

Instance Method Summary collapse

Constructor Details

#initialize(gem_specification:, git_adapter:) ⇒ DecorateUnusedGems

Returns a new instance of DecorateUnusedGems.



5
6
7
8
# File 'lib/degem/decorate_unused_gems.rb', line 5

def initialize(gem_specification:, git_adapter:)
  @gem_specification = gem_specification
  @git_adapter = git_adapter
end

Instance Method Details

#call(rubygems) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/degem/decorate_unused_gems.rb', line 10

def call(rubygems)
  rubygems.map do |rubygem|
    gemspec = @gem_specification.find_by_name(rubygem.name)
    git = @git_adapter.call(rubygem.name)
    UnusedGem.new(rubygem, gemspec, git)
  end
end