Sha256: 4194dca6e8d77ca11b9a9200342d1dcaa6ca782e266b562d85c4e763adfc3d45
Contents?: true
Size: 910 Bytes
Versions: 8
Compression:
Stored size: 910 Bytes
Contents
require 'json' module Hrw module Scanner # # Used to scan gem lock file # class Pipfile attr_reader :package_manager # Class constructor # # @param [String] root The path to the project root # @param [String] lockfile # The name for the lock file, default is `Pipfile.lock` def initialize(root = Dir.pwd, lockfile = 'Pipfile.lock') @package_manager = 'pypi' @root = root @lockfile = lockfile end # Scan the lock file # @return [Hash] Dependencies def scan deps = [] lock = JSON.parse(File.read(File.join(@root, @lockfile))) lock['default'].each_pair do |name, info| next if info['version'].nil? deps << { name: name, version: info['version'].delete_prefix('==') } end deps end end end end
Version data entries
8 entries across 8 versions & 1 rubygems