Class: Dependabot::Hex::FileParser
- Inherits:
-
FileParsers::Base
- Object
- FileParsers::Base
- Dependabot::Hex::FileParser
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/hex/file_parser.rb
Instance Method Summary collapse
Instance Method Details
#ecosystem ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/dependabot/hex/file_parser.rb', line 54 def ecosystem @ecosystem ||= T.let( begin Ecosystem.new( name: ECOSYSTEM, package_manager: package_manager, language: language ) end, T.nilable(Dependabot::Ecosystem) ) end |
#parse ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/dependabot/hex/file_parser.rb', line 27 def parse # TODO: git sourced dependency's mixfiles are evaluated. Provide guards before removing this. raise ::Dependabot::UnexpectedExternalCode if @reject_external_code dependency_set = DependencySet.new dependency_details.each do |dep| git_dependency = dep["source"]&.fetch("type") == "git" dependency_set << Dependency.new( name: dep["name"], version: git_dependency ? dep["checksum"] : dep["version"], requirements: [{ requirement: dep["requirement"], groups: dep["groups"], source: dep["source"] && symbolize_keys(dep["source"]), file: dep["from"] }], package_manager: "hex" ) end dependency_set.dependencies.sort_by(&:name) end |