Sha256: 8ee4fae48a44319b70734c30adffc6aed0494f5450948254fb1df37ee6bb1d82
Contents?: true
Size: 582 Bytes
Versions: 12
Compression:
Stored size: 582 Bytes
Contents
module Gurney module Source class Yarn < Base YARN_LOCK_REGEX = /^"?(?<name>\S*)@.+?"?:\n\s{2}version "(?<version>.+?)"$/m def initialize(yarn_lock:) @yarn_lock = yarn_lock end def present? !@yarn_lock.nil? end def dependencies if present? dependencies = @yarn_lock.scan(YARN_LOCK_REGEX).map{|match| { name: match[0], version: match[1] } } dependencies.map { |dependency| Dependency.new(ecosystem: 'npm', **dependency) } end end private attr_reader :yarn_lock end end end
Version data entries
12 entries across 12 versions & 1 rubygems