Created
September 2, 2016 10:18
-
-
Save arashbm/bda890545740b322e505c1215c4c6269 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
JSON.parse(ARGF.read).map do |package, value| | |
package_name = package.split('@')[-2] | |
puts "\n" | |
if value["url"] | |
puts "[#{package_name}](#{value["url"]})" | |
puts "="*(package_name.length + value["url"].length + 4) | |
else | |
puts package_name | |
puts "="*package_name.length | |
end | |
puts "\nPublisher: #{value["publisher"]}\n" if value["publisher"] | |
puts "\n" | |
if value["licenseFile"] | |
puts File.read(value["licenseFile"]).lines.map { |l| " #{l}"} | |
else | |
puts "No license file was available but the source code is available "\ | |
"under #{value["licenses"]}\n" | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: