Class: Bundler::Dependencies::Scanner

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/dependencies/scanner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = Bundler.default_lockfile) ⇒ Scanner

Returns a new instance of Scanner.



8
9
10
11
# File 'lib/bundler/dependencies/scanner.rb', line 8

def initialize(path = Bundler.default_lockfile)
  @lockfile = LockfileParser.new(Bundler.read_file(path))
  @graph = Graph.new(lockfile: lockfile)
end

Instance Attribute Details

#graphObject (readonly)

Returns the value of attribute graph.



6
7
8
# File 'lib/bundler/dependencies/scanner.rb', line 6

def graph
  @graph
end

Instance Method Details

#gem_countObject



13
14
15
# File 'lib/bundler/dependencies/scanner.rb', line 13

def gem_count
  gems.count
end

#spec_countObject



17
18
19
# File 'lib/bundler/dependencies/scanner.rb', line 17

def spec_count
  specs.count
end

#to_sObject



21
22
23
# File 'lib/bundler/dependencies/scanner.rb', line 21

def to_s
  "#{gem_count} gems scanned; #{spec_count} dependencies found"
end