Class: Package::Audit::Npm::YarnLockParser
- Inherits:
-
Object
- Object
- Package::Audit::Npm::YarnLockParser
- Defined in:
- lib/package/audit/npm/yarn_lock_parser.rb
Instance Method Summary collapse
- #fetch(default_deps, dev_deps, resolutions = {}) ⇒ Object
-
#initialize(yarn_lock_path) ⇒ YarnLockParser
constructor
A new instance of YarnLockParser.
Constructor Details
#initialize(yarn_lock_path) ⇒ YarnLockParser
Returns a new instance of YarnLockParser.
7 8 9 10 |
# File 'lib/package/audit/npm/yarn_lock_parser.rb', line 7 def initialize(yarn_lock_path) @yarn_lock_file = File.read(yarn_lock_path) @yarn_lock_path = yarn_lock_path end |
Instance Method Details
#fetch(default_deps, dev_deps, resolutions = {}) ⇒ Object
12 13 14 15 16 |
# File 'lib/package/audit/npm/yarn_lock_parser.rb', line 12 def fetch(default_deps, dev_deps, resolutions = {}) default_deps.merge(dev_deps).map do |dep_name, expected_version| process_package(dep_name, expected_version, dev_deps, resolutions) end end |