Class: Gem::Commands::BlameCommand

Inherits:
Gem::Command
  • Object
show all
Includes:
GemcutterUtilities
Defined in:
lib/rubygems/commands/blame_command.rb

Instance Method Summary collapse

Constructor Details

#initializeBlameCommand

Returns a new instance of BlameCommand.



10
11
12
# File 'lib/rubygems/commands/blame_command.rb', line 10

def initialize
  super 'blame', description
end

Instance Method Details

#descriptionObject



6
7
8
# File 'lib/rubygems/commands/blame_command.rb', line 6

def description
  'See who is responsible for this gem'
end

#executeObject



14
15
16
17
18
19
# File 'lib/rubygems/commands/blame_command.rb', line 14

def execute
  require 'json'
  response = rubygems_api_request(:get, "api/v1/gems/#{get_one_gem_name}.json")
  json = JSON.parse(response.body)
  say json["authors"]
end