module Rubygems::API::Gems

Method relating to gem ownership

Public Instance Methods

add_gem_owner(gem_name, email, args = {}) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 13
def add_gem_owner(gem_name, email, args = {})
  @client.post("gems/#{gem_name}/owners", email: email)
end
gem_dependencies(args = []) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 55
def gem_dependencies(args = [])
  response = @client.get('dependencies', {}.tap do |hash|
    args = Array.new(1, args) if args.is_a? String
    hash[:gems] = args.join(',')
  end)

  response.body = Marshal.load(response.body)

  response
end
gem_downloads(gem_name, gem_version, format = 'json', args = {}) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 51
def gem_downloads(gem_name, gem_version, format = 'json', args = {})
  get("downloads/#{gem_name}-#{gem_version}.#{format}", format, nil, args)
end
gem_info(name, format = 'json', args = {}) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 21
def gem_info(name, format = 'json', args = {})
  get("gems/#{name}.#{format}", format, nil, args)
end
gem_owners(gem_name, format = 'json', args = {}) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 9
def gem_owners(gem_name, format = 'json', args = {})
  get("gems/#{gem_name}/owners.#{format}", format, nil, args)
end
gem_versions(gem_name, format = 'json', args = {}) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 47
def gem_versions(gem_name, format = 'json', args = {})
  get("versions/#{gem_name}.#{format}", format, nil, args)
end
gems_by_owner(username, format = 'json', args = {}) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 5
def gems_by_owner(username, format = 'json', args = {})
  get("owners/#{username}/gems.#{format}", format, nil, args)
end
my_gems(format = 'json', args = {}) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 29
def my_gems(format = 'json', args = {})
  get("gems.#{format}", format, nil, args)
end
remove_gem_owner(gem_name, email, args = {}) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 17
def remove_gem_owner(gem_name, email, args = {})
  @client.delete("gems/#{gem_name}/owners", email: email)
end
submit_gem(gem_file) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 33
def submit_gem(gem_file)
  @client.post(
    'gems',
    file: Hurley::UploadIO.new(gem_file.read, 'application/octet-stream'))
end
unyank_gem(gem_name, gem_version = nil, args = {}) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 43
def unyank_gem(gem_name, gem_version = nil, args = {})
  yank_api('gems/unyank', :put, gem_name, gem_version, args)
end
yank_gem(gem_name, gem_version = nil, args = {}) click to toggle source
# File lib/rubygems_api/actions/gems.rb, line 39
def yank_gem(gem_name, gem_version = nil, args = {})
  yank_api('gems/yank', :delete, gem_name, gem_version, args)
end