mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems: Update to RubyGems 2.4.1 master(713ab65)
Complete history at: https://github.com/rubygems/rubygems/blob/master/History.txt#L3-L216 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e548c09d42
commit
4de117a615
153 changed files with 5400 additions and 981 deletions
|
@ -44,10 +44,7 @@ as the reason for the removal request.
|
|||
options[:undo] = true
|
||||
end
|
||||
|
||||
add_option('-k', '--key KEY_NAME',
|
||||
'Use API key from your gem credentials file') do |value, options|
|
||||
options[:key] = value
|
||||
end
|
||||
add_key_option
|
||||
end
|
||||
|
||||
def execute
|
||||
|
@ -55,14 +52,12 @@ as the reason for the removal request.
|
|||
|
||||
version = get_version_from_requirements(options[:version])
|
||||
platform = get_platform_from_requirements(options)
|
||||
api_key = Gem.configuration.rubygems_api_key
|
||||
api_key = Gem.configuration.api_keys[options[:key].to_sym] if options[:key]
|
||||
|
||||
if version then
|
||||
if options[:undo] then
|
||||
unyank_gem(version, platform, api_key)
|
||||
unyank_gem(version, platform)
|
||||
else
|
||||
yank_gem(version, platform, api_key)
|
||||
yank_gem(version, platform)
|
||||
end
|
||||
else
|
||||
say "A version argument is required: #{usage}"
|
||||
|
@ -70,19 +65,19 @@ as the reason for the removal request.
|
|||
end
|
||||
end
|
||||
|
||||
def yank_gem(version, platform, api_key)
|
||||
def yank_gem(version, platform)
|
||||
say "Yanking gem from #{self.host}..."
|
||||
yank_api_request(:delete, version, platform, "api/v1/gems/yank", api_key)
|
||||
yank_api_request(:delete, version, platform, "api/v1/gems/yank")
|
||||
end
|
||||
|
||||
def unyank_gem(version, platform, api_key)
|
||||
def unyank_gem(version, platform)
|
||||
say "Unyanking gem from #{host}..."
|
||||
yank_api_request(:put, version, platform, "api/v1/gems/unyank", api_key)
|
||||
yank_api_request(:put, version, platform, "api/v1/gems/unyank")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def yank_api_request(method, version, platform, api, api_key)
|
||||
def yank_api_request(method, version, platform, api)
|
||||
name = get_one_gem_name
|
||||
response = rubygems_api_request(method, api) do |request|
|
||||
request.add_field("Authorization", api_key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue