Created
June 14, 2019 13:41
-
-
Save haarts/eda0f749c813ba6b78502d3ce10fd74a to your computer and use it in GitHub Desktop.
Check if the versions defined in a Dart pubspec file are still up to date
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 'yaml' | |
require 'net/http' | |
require 'json' | |
url = 'https://pub.dev/api/packages/' | |
local_spec = YAML.load_file('pubspec.yaml') | |
local_spec["dependencies"].each do |lib, version| | |
if !version.is_a? String | |
next | |
end | |
response = Net::HTTP.get(URI(url+lib)) | |
puts([lib, version, "->", JSON.parse(response)["latest"]["version"]].join(" ")) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment