Sha256: a02f61e4753b11f78e711d231b3662b533069d0dc5a0834a25f1be2a3eb2be27

Contents?: true

Size: 554 Bytes

Versions: 2

Compression:

Stored size: 554 Bytes

Contents

require 'dep_analyzer'

class RubygemsAnalyzer < DepAnalyzer
  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

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
graph-1.2.0 lib/rubygems_analyzer.rb
graph-1.1.0 lib/rubygems_analyzer.rb