Skip to content

Commit

Permalink
Merge branch 'master' of github.com:librariesio/bibliothecary
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrelsouza committed Jan 22, 2021
2 parents 143c435 + 064aa6e commit 2fed885
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lib/bibliothecary/parsers/nuget.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ def self.parse_packages_lock_json(file_contents)
if frameworks.size > 0
# we should really return multiple manifests, but bibliothecary doesn't
# do that yet so at least pick deterministically.
frameworks[frameworks.keys.sort.last]
else
[]

# Note, frameworks can be empty, so remove empty ones and then return the last sorted item if any
frameworks = frameworks.delete_if { |k, v| v.empty? }
return frameworks[frameworks.keys.sort.last] unless frameworks.empty?
end
[]
end

def self.parse_packages_config(file_contents)
Expand Down
6 changes: 4 additions & 2 deletions spec/fixtures/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"version": 1,
"dependencies": {
".Empty-group-earlier-alphabetically": {},
".NETCoreApp,Version=v2.2": {
"Microsoft.AspNetCore.App": {
"type": "Direct",
Expand Down Expand Up @@ -3099,6 +3100,7 @@
"System.Xml.XPath": "4.3.0"
}
}
}
},
"Empty-group-later-alphabetically": {}
}
}
}

0 comments on commit 2fed885

Please sign in to comment.