2016-02-01 07:43:26 -05:00
|
|
|
# frozen_string_literal: true
|
2009-06-09 17:38:59 -04:00
|
|
|
require 'rubygems/command_manager'
|
|
|
|
|
2010-04-22 04:24:42 -04:00
|
|
|
##
|
|
|
|
# This is an example of exactly what NOT to do.
|
|
|
|
#
|
|
|
|
# DO NOT include code like this in your rubygems_plugin.rb
|
|
|
|
|
2016-04-27 20:33:08 -04:00
|
|
|
module Gem::Commands
|
|
|
|
remove_const(:InterruptCommand) if defined?(InterruptCommand)
|
|
|
|
end
|
|
|
|
|
2009-06-09 17:38:59 -04:00
|
|
|
class Gem::Commands::InterruptCommand < Gem::Command
|
|
|
|
def initialize
|
|
|
|
super('interrupt', 'Raises an Interrupt Exception', {})
|
|
|
|
end
|
|
|
|
|
|
|
|
def execute
|
|
|
|
raise Interrupt, "Interrupt exception"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Gem::CommandManager.instance.register_command :interrupt
|