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.



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

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.



4
5
6
# File 'lib/bundler/dependencies/scanner.rb', line 4

def graph
  @graph
end

Instance Method Details

#gem_countObject



11
12
13
# File 'lib/bundler/dependencies/scanner.rb', line 11

def gem_count
  gems.count
end

#spec_countObject



15
16
17
# File 'lib/bundler/dependencies/scanner.rb', line 15

def spec_count
  specs.count
end

#to_sObject



19
20
21
# File 'lib/bundler/dependencies/scanner.rb', line 19

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