Skip to content

Instantly share code, notes, and snippets.

@thbar
Created November 28, 2013 10:10
Show Gist options
  • Save thbar/7689740 to your computer and use it in GitHub Desktop.
Save thbar/7689740 to your computer and use it in GitHub Desktop.
Quick, slow, dirty way to verify how aged your gems are.
task :outdated => :environment do
include ActionView::Helpers::DateHelper
regexp = /\* ([^ ]+) \((\S+) > ([^)]+)\)/
outdated = `bundle outdated`.scan(regexp)
outdated.each do |gem_name, available, current|
data = JSON.parse(`curl --silent https://rubygems.org/api/v1/versions/#{gem_name}.json`)
version = data.find { |e| e['number'] == current }
age = distance_of_time_in_words_to_now(Time.parse(version['built_at']))
puts " * #{gem_name}: (#{available} > #{current}, built #{age} ago)"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment