Skip to content

Instantly share code, notes, and snippets.

@s-aska s-aska/version-check.rb
Last active Aug 29, 2015

Embed
What would you like to do?
maven version check
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
def compile(library)
package, name, version = library.split(':')
filepath = package.gsub(/\./, '/') + '/' + name
url = "http://search.maven.org/remotecontent?filepath=#{filepath}/maven-metadata.xml"
res = Net::HTTP.get URI.parse(url)
version_match = /<latest>(.*)<\/latest>/.match(res)
if version_match then
latest_version = version_match[1]
if version == latest_version then
puts sprintf("\e[32m✔\e[0m" + ' %s', library)
else
puts sprintf("\e[31m✖\e[0m" + ' %s => !!! %s !!!', library, latest_version)
end
end
end
compile 'com.google.code.gson:gson:2.2.4'
compile 'de.greenrobot:eventbus:2.2.0'
compile 'org.twitter4j:twitter4j-core:4.0.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.1'
compile 'com.jakewharton:butterknife:4.0.1'
compile 'com.viewpagerindicator:library:2.4.1'
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:0.9.9'
@s-aska

This comment has been minimized.

Copy link
Owner Author

s-aska commented May 19, 2014

logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.