Class: Spandx::Js::YarnLock

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/spandx/js/yarn_lock.rb

Constant Summary collapse

START_OF_DEPENDENCY_REGEX =
%r{^"?(?<name>(@|\w|-|\.|/)+)@}i.freeze
INJECT_COLON =
/(?<=\w|")\s(?=\w|")/.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ YarnLock

Returns a new instance of YarnLock.



13
14
15
16
# File 'lib/spandx/js/yarn_lock.rb', line 13

def initialize(file_path)
  @file_path = file_path
  @metadatum = collect_metadatum
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



11
12
13
# File 'lib/spandx/js/yarn_lock.rb', line 11

def file_path
  @file_path
end

Instance Method Details

#eachObject



18
19
20
21
22
# File 'lib/spandx/js/yarn_lock.rb', line 18

def each
  @metadatum.each do ||
    yield 
  end
end