Permalink
Browse files

Fetch YAML response for info, search, and gems

Progress toward #4 (removing multi_json dependency).
  • Loading branch information...
1 parent 62d78b5 commit 9c07687a598063be75ed74425e73cbad998180f4 @sferik committed Jul 18, 2011
View
@@ -23,8 +23,8 @@ def initialize(options={})
# @example
# Gems.info 'rails'
def info(gem_name)
- response = get("/api/v1/gems/#{gem_name}.json")
- MultiJson.decode(response)
+ response = get("/api/v1/gems/#{gem_name}.yaml")
+ YAML.load(response)
end
# Returns an array of active gems that match the query
@@ -34,8 +34,8 @@ def info(gem_name)
# @example
# Gems.search 'cucumber'
def search(query)
- response = get("/api/v1/search.json", {:query => query})
- MultiJson.decode(response)
+ response = get("/api/v1/search.yaml", {:query => query})
+ YAML.load(response)
end
# Returns an array of gem version details
@@ -98,8 +98,8 @@ def api_key
# @example
# Gems.gems
def gems
- response = get("/api/v1/gems.json")
- MultiJson.decode(response)
+ response = get("/api/v1/gems.yaml")
+ YAML.load(response)
end
# View all owners of a gem that you own
View

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 9c07687

Please sign in to comment.