Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
find and copy the latest version of a gem
$ latest haml
request: http://rubygems.org/api/v1/gems/haml.json
version: 3.0.25
# cmd+v
$ 3.0.25
#!/usr/bin/env ruby
require "net/http"
require "uri"
require "json"
if gem = ARGV.first
uri = URI.parse("http://rubygems.org/api/v1/gems/#{gem}.json")
puts "request: #{uri}"
begin
response = Net::HTTP.get_response(uri)
version = JSON.parse(response.body)["version"]
puts "version: #{version}"
`echo "#{version}" | pbcopy`
rescue => e
puts "oops ..."
puts e
end
else
puts "what?"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.