From 78eec7bd6c19a23d579c1e651fdaf60b940dd558 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Sat, 27 Aug 2011 13:02:21 -0400 Subject: [PATCH] add docs about authentication for api and publishing gems, close #4 --- make-your-own-gem.md | 17 +++++++++-------- rubygems-org-api.md | 11 +++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/make-your-own-gem.md b/make-your-own-gem.md index 0569429..ecafe78 100644 --- a/make-your-own-gem.md +++ b/make-your-own-gem.md @@ -101,16 +101,17 @@ Of course, our smoke test isn’t over yet: Let’s `require` our gem and use it >> Hola.hi Hello world! -Hola now needs to be shared with the rest of the Ruby community. Publishing -your gem out to RubyGems.org only takes one command, granted you have an -account on the site. Once you’re signed up, then you can push out a gem. +Hola now needs to be shared with the rest of the Ruby community. Publishing your +gem out to RubyGems.org only takes one command, granted you have an account on +the site. To setup your computer with your rubygems account: + + $ curl -u qrush https://rubygems.org/api/v1/api_key.yaml > + ~/.gem/credentials + Enter host password for user 'qrush': + +Once this has been setup, push out the gem: % gem push hola-0.0.0.gem - Enter your RubyGems.org credentials. - Don't have an account yet? Create one at http://rubygems.org/sign_up - Email: nick@quaran.to - Password: - Signed in. Pushing gem to RubyGems.org... Successfully registered gem: hola (0.0.0) diff --git a/rubygems-org-api.md b/rubygems-org-api.md index 1884b0d..e0eef35 100644 --- a/rubygems-org-api.md +++ b/rubygems-org-api.md @@ -21,6 +21,17 @@ add owners, and more. * [Webhook Methods](#webhook): Manage notifications for when gems are pushed * [Misc Methods](#misc): Various other interactions with the site + +API Authorization +----------------- + +Some API calls require an Authorization header. To find your API key, click on +your username when logged in and then click on 'Edit Profile'. An example of +using the API key: + + $ curl -H 'Authorization:YOUR_API_KEY' \ + https://rubygems.org/api/v1/some_api_call.json + Ruby Library ------------