Skip to content

Commit

Permalink
Properly parse version from options hash for gem yank
Browse files Browse the repository at this point in the history
  • Loading branch information
jtrupiano authored and qrush committed Mar 1, 2010
1 parent d38f025 commit baf3a19
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gem/lib/rubygems/commands/yank.rb
Expand Up @@ -26,7 +26,7 @@ def initialize

def execute
sign_in
version = options[:version]
version = get_version_from_requirements(options[:version])
if !version.nil?
yank_gem(version)
else
Expand All @@ -48,4 +48,13 @@ def yank_gem(version)

say response.body
end

private
def get_version_from_requirements(requirements)
begin
requirements.requirements.first[1].version
rescue
nil
end
end
end

0 comments on commit baf3a19

Please sign in to comment.