Sha256: 5f52cfe5636e40f2cddea832997b1c91c864635e927896d2651dc76eab54f4fb

Contents?: true

Size: 625 Bytes

Versions: 2

Compression:

Stored size: 625 Bytes

Contents

module Bundler
  module Dependencies
    class Scanner
      attr_reader :graph

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

      def gem_count
        gems.count
      end

      def spec_count
        specs.count
      end

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

    private

      attr_reader :lockfile

      def gems
        lockfile.dependencies.keys
      end

      def specs
        lockfile.specs
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bundler-dependencies-0.6.0 lib/bundler/dependencies/scanner.rb
bundler-dependencies-0.5.1 lib/bundler/dependencies/scanner.rb