Skip to content

Instantly share code, notes, and snippets.

@s-aska
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-aska/398cb20dbef43ef6fbdb to your computer and use it in GitHub Desktop.
Save s-aska/398cb20dbef43ef6fbdb to your computer and use it in GitHub Desktop.
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
Copy link
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