Class: SilentPackageManager::FileParser
- Inherits:
-
Dependabot::FileParsers::Base
- Object
- Dependabot::FileParsers::Base
- SilentPackageManager::FileParser
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/silent/file_parser.rb
Instance Method Summary collapse
Instance Method Details
#ecosystem ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/dependabot/silent/file_parser.rb', line 32 def ecosystem = JSON.parse(manifest_content)["silent"] silent_version = if .nil? "2" else ["version"] end @ecosystem ||= T.let( Dependabot::Ecosystem.new( name: Dependabot::Silent::ECOSYSYEM, package_manager: Dependabot::Silent::PackageManager.new(silent_version) ), T.nilable(Dependabot::Ecosystem) ) rescue JSON::ParserError raise Dependabot::DependencyFileNotParseable, T.must(dependency_files.first).path end |
#parse ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dependabot/silent/file_parser.rb', line 18 def parse dependency_set = DependencySet.new JSON.parse(manifest_content).each do |name, info| dependency_set << parse_single_dependency(name, info) if info.key?("version") dependency_set << parse_multiple_dependency(name, info) if info.key?("versions") end dependency_set.dependencies rescue JSON::ParserError raise Dependabot::DependencyFileNotParseable, T.must(dependency_files.first).path end |