Permalink
Browse files

Rename name to gem_name and version to gem_version

  • Loading branch information...
1 parent 36c8c48 commit 5858ca8eab320b3fb1215dca7662077be1e404c8 @sferik committed Jul 2, 2011
Showing with 29 additions and 29 deletions.
  1. +29 −29 lib/gems/client.rb
View
@@ -18,12 +18,12 @@ def initialize(options={})
# Returns some basic information about the given gem
#
- # @param gem [String] The name of a gem.
+ # @param gem_name [String] The name of a gem.
# @return [Hashie::Mash]
# @example
# Gems.info 'rails'
- def info(gem)
- response = get("/api/v1/gems/#{gem}")
+ def info(gem_name)
+ response = get("/api/v1/gems/#{gem_name}")
format.to_s.downcase == 'xml' ? response['rubygem'] : response
end
@@ -40,28 +40,28 @@ def search(query)
# Returns an array of gem version details
#
- # @param gem [String] The name of a gem.
+ # @param gem_name [String] The name of a gem.
# @return [Hashie::Mash]
# @example
# Gems.versions 'coulda'
- def versions(gem)
- get("/api/v1/versions/#{gem}", {}, :json)
+ def versions(gem_name)
+ get("/api/v1/versions/#{gem_name}", {}, :json)
end
# Returns the number of downloads by day for a particular gem version
#
- # @param gem [String] The name of a gem.
- # @param version [String] The version of a gem.
+ # @param gem_name [String] The name of a gem.
+ # @param gem_version [String] The version of a gem.
# @param from [Date] Search start date.
# @param to [Date] Search end date.
# @return [Hashie::Mash]
# @example
# Gems.downloads 'coulda', '0.6.3', Date.today - 30, Date.today
- def downloads(gem, version, from=nil, to=Date.today)
+ def downloads(gem_name, gem_version, from=nil, to=Date.today)
if from
- get("/api/v1/versions/#{gem}-#{version}/downloads/search", {:from => from.to_s, :to => to.to_s}, :json)
+ get("/api/v1/versions/#{gem_name}-#{gem_version}/downloads/search", {:from => from.to_s, :to => to.to_s}, :json)
else
- get("/api/v1/versions/#{gem}-#{version}/downloads", {}, :json)
+ get("/api/v1/versions/#{gem_name}-#{gem_version}/downloads", {}, :json)
end
end
@@ -103,43 +103,43 @@ def gems
# View all owners of a gem that you own
#
- # @param gem [String] The name of a gem.
+ # @param gem_name [String] The name of a gem.
# @return [Array]
# @example
# Gems.configure do |config|
# config.key = '701243f217cdf23b1370c7b66b65ca97'
# end
# Gems.owners('gemcutter')
- def owners(gem)
- get("/api/v1/gems/#{gem}/owners", {}, :json)
+ def owners(gem_name)
+ get("/api/v1/gems/#{gem_name}/owners", {}, :json)
end
# Add an owner to a RubyGem you own, giving that user permission to manage it
#
- # @param gem [String] The name of a gem.
+ # @param gem_name [String] The name of a gem.
# @param owner [String] The email address of the user you want to add.
# @return [String]
# @example
# Gems.configure do |config|
# config.key = '701243f217cdf23b1370c7b66b65ca97'
# end
# Gems.add_owner("gemcutter", "josh@technicalpickles.com")
- def add_owner(gem, owner)
- post("/api/v1/gems/#{gem}/owners", {:email => owner}, :raw)
+ def add_owner(gem_name, owner)
+ post("/api/v1/gems/#{gem_name}/owners", {:email => owner}, :raw)
end
# Remove a user's permission to manage a RubyGem you own
#
- # @param gem [String] The name of a gem.
+ # @param gem_name [String] The name of a gem.
# @param owner [String] The email address of the user you want to remove.
# @return [String]
# @example
# Gems.configure do |config|
# config.key = '701243f217cdf23b1370c7b66b65ca97'
# end
# Gems.remove_owner("gemcutter", "josh@technicalpickles.com")
- def remove_owner(gem, owner)
- delete("/api/v1/gems/#{gem}/owners", {:email => owner}, :raw)
+ def remove_owner(gem_name, owner)
+ delete("/api/v1/gems/#{gem_name}/owners", {:email => owner}, :raw)
end
# List the webhooks registered under your account
@@ -156,44 +156,44 @@ def web_hooks
# Create a webhook
#
- # @param gem [String] The name of a gem. Specify "*" to add the hook to all your gems.
+ # @param gem_name [String] The name of a gem. Specify "*" to add the hook to all your gems.
# @param url [String] The URL of the web hook.
# @return [String]
# @example
# Gems.configure do |config|
# config.key = '701243f217cdf23b1370c7b66b65ca97'
# end
# Gems.add_web_hook("rails", "http://example.com")
- def add_web_hook(gem, url)
- post("/api/v1/web_hooks", {:gem_name => gem, :url => url}, :raw)
+ def add_web_hook(gem_name, url)
+ post("/api/v1/web_hooks", {:gem_name => gem_name, :url => url}, :raw)
end
# Remove a webhook
#
- # @param gem [String] The name of a gem. Specify "*" to remove the hook from all your gems.
+ # @param gem_name [String] The name of a gem. Specify "*" to remove the hook from all your gems.
# @param url [String] The URL of the web hook.
# @return [String]
# @example
# Gems.configure do |config|
# config.key = '701243f217cdf23b1370c7b66b65ca97'
# end
# Gems.remove_web_hook("rails", "http://example.com")
- def remove_web_hook(gem, url)
- delete("/api/v1/web_hooks/remove", {:gem_name => gem, :url => url}, :raw)
+ def remove_web_hook(gem_name, url)
+ delete("/api/v1/web_hooks/remove", {:gem_name => gem_name, :url => url}, :raw)
end
# Test fire a webhook
#
- # @param gem [String] The name of a gem. Specify "*" to fire the hook for all your gems.
+ # @param gem_name [String] The name of a gem. Specify "*" to fire the hook for all your gems.
# @param url [String] The URL of the web hook.
# @return [String]
# @example
# Gems.configure do |config|
# config.key = '701243f217cdf23b1370c7b66b65ca97'
# end
# Gems.fire_web_hook("rails", "http://example.com")
- def fire_web_hook(gem, url)
- post("/api/v1/web_hooks/fire", {:gem_name => gem, :url => url}, :raw)
+ def fire_web_hook(gem_name, url)
+ post("/api/v1/web_hooks/fire", {:gem_name => gem_name, :url => url}, :raw)
end
end
end

0 comments on commit 5858ca8

Please sign in to comment.