Class: RubygemsAnalyzer

Inherits:
DepAnalyzer show all
Defined in:
lib/rubygems_analyzer.rb

Instance Method Summary collapse

Methods inherited from DepAnalyzer

#initialize, #run

Methods inherited from Cache

#cache, #initialize

Constructor Details

This class inherits a constructor from DepAnalyzer

Instance Method Details

#deps(port) ⇒ Object



19
20
21
# File 'lib/rubygems_analyzer.rb', line 19

def deps port
  Gem.source_index.find_name(port).first.dependencies.map { |dep| dep.name }
end

#installedObject



4
5
6
7
8
9
10
11
# File 'lib/rubygems_analyzer.rb', line 4

def installed
  require 'rubygems'
  ENV['GEM_PATH'] = `gem env home`
  Gem.clear_paths
  # don't cache so it updates every delete
  puts "scanning installed rubygems"
  Gem.source_index.gems.values.map { |gem| gem.name }.sort
end

#outdatedObject



13
14
15
16
17
# File 'lib/rubygems_analyzer.rb', line 13

def outdated
  # don't cache so it updates every delete
  puts "scanning outdated rubygems"
  Gem.source_index.outdated.sort
end