Class: Dependabot::NpmAndYarn::FileParser::YarnLockfileParser
- Inherits:
-
Object
- Object
- Dependabot::NpmAndYarn::FileParser::YarnLockfileParser
- Defined in:
- lib/dependabot/npm_and_yarn/file_parser/yarn_lockfile_parser.rb
Instance Method Summary collapse
-
#initialize(lockfile:) ⇒ YarnLockfileParser
constructor
A new instance of YarnLockfileParser.
-
#parse ⇒ Object
This is extremely crude, but saves us from having to shell out to Yarn, which may not be safe.
Constructor Details
#initialize(lockfile:) ⇒ YarnLockfileParser
Returns a new instance of YarnLockfileParser.
10 11 12 |
# File 'lib/dependabot/npm_and_yarn/file_parser/yarn_lockfile_parser.rb', line 10 def initialize(lockfile:) @content = lockfile.content end |
Instance Method Details
#parse ⇒ Object
This is extremely crude, but saves us from having to shell out to Yarn, which may not be safe
16 17 18 19 20 |
# File 'lib/dependabot/npm_and_yarn/file_parser/yarn_lockfile_parser.rb', line 16 def parse yaml = convert_to_yaml lockfile_object = parse_as_yaml(yaml) (lockfile_object) end |