Ruby wrapper for the RubyGems.org API.
gem install gems
To ensure the code you're installing hasn't been tampered with, it's recommended that you verify the signature. To do this, you need to add my public key as a trusted certificate (you only need to do this once):
gem cert --add <(curl -Ls https://raw.github.com/rubygems/gems/master/certs/sferik.pem)
Then, install the gem with the high security trust policy:
gem install gems -P HighSecurity
require 'rubygems' require 'gems' # Return some basic information about rails. .info 'rails' # Return an array of active gems that match the query. .search 'cucumber' # Return all gems that you own. .gems # Return all gems owned by Erik Michaels-Ober. .gems("sferik") # Submit a gem to RubyGems.org. .push File.new 'gemcutter-0.2.1.gem' # Remove a gem from RubyGems.org's index. # Defaults to the latest version if no version is specified. .yank 'bills', '0.0.1' # Update a previously yanked gem back into RubyGems.org's index. # Defaults to the latest version if no version is specified. .unyank 'bills', '0.0.1' # Return an array of version details for coulda. .versions 'coulda' # Return the total number of downloads for rails_admin 0.0.1. # (Defaults to the latest version if no version is specified.) .total_downloads 'rails_admin', '0.0.1' # Returns an array containing the top 50 downloaded gem versions for today. .most_downloaded_today # Returns an array containing the top 50 downloaded gem versions of all time. .most_downloaded # Return the total number of downloads by day for rails_admin 0.0.1. # (Defaults to the latest version if no version is specified.) .downloads 'rails_admin', '0.0.1' # Return the number of downloads by day for coulda 0.6.3 for the past 90 days. # (Defaults to the latest version if no version is specified.) .downloads 'coulda', '0.6.3' # Return the number of downloads by day for coulda 0.6.3 for the past year. .downloads 'coulda', '0.6.3', Date.today - 365, Date.today # View all owners of a gem that you own. .owners 'gemcutter' # Add an owner to a RubyGem you own, giving that user permission to manage it. .add_owner 'firstname.lastname@example.org', 'gemcutter' # Remove a user's permission to manage a RubyGem you own. .remove_owner 'email@example.com', 'gemcutter' # Return all the webhooks registered under your account. .web_hooks # Add a webhook. .add_web_hook 'rails', 'http://example.com' # Remove a webhook. .remove_web_hook 'rails', 'http://example.com' # Test fire a webhook. .fire_web_hook 'rails', 'http://example.com' # Returns the 50 gems most recently added to RubyGems.org .latest # Returns the 50 most recently updated gems .just_updated # Retrieve your API key using HTTP basic authentication. . do |config| config.username = 'firstname.lastname@example.org' config.password = 'schwwwwing' end .api_key # Return an array of gem dependency details for all versions of all the given gems. .dependencies ['rails', 'thor'] # The following methods require authentication. # By default, we load your API key from ~/.gem/credentails # You can override this default by specifying a custom API key. . do |config| config.key '701243f217cdf23b1370c7b66b65ca97' end
Supported Ruby Versions
This library aims to support and is tested against the following Ruby implementations:
If something doesn't work on one of these interpreters, it's a bug.
This library may inadvertently work (or seem to work) on other Ruby implementations, however support will only be provided for the versions listed above.
If you would like this library to support another Ruby version, you may volunteer to be a maintainer. Being a maintainer entails making sure all tests run and pass on that implementation. When something breaks on your implementation, you will be responsible for providing patches in a timely fashion. If critical issues for a particular implementation exist at the time of a major release, support for that Ruby version may be dropped.
Copyright (c) 2011-2013 Erik Michaels-Ober. See LICENSE for details.