Tidier formulation of archive.json and recipes.json intersection

This commit is contained in:
Steve Purcell 2013-03-25 14:58:09 +00:00
parent 24f1c6ed4c
commit ab0be98cb9

View file

@ -5,7 +5,7 @@
archive_json = JSON.parse(File.open("../archive.json").read)
recipe_json = JSON.parse(File.open("../recipes.json").read)
packages = archive_json.keys.select { |k| recipe_json.has_key?(k) }.sort.map do |pkgname|
packages = (archive_json.keys & recipe_json.keys).sort.map do |pkgname|
package = OpenStruct.new
package.name = pkgname
versions, deps, package.descr, package.pkgtype = archive_json[package.name]