Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (19 sloc) 739 Bytes
class ChuckNorris
def initialize
file, line, method = caller[0].split ":"
method = method.match(/`(.*)'/)[1]
source = File.readlines(file)
pointer = line.to_i - 1
(line.to_i - 1).downto(0) do |i|
break if source[i].match(/class (.*)\s/)
return "Ah, nice try." if $1 == "ChuckNorris"
puts "No one initializes Chuck Norris, do you understand #{$1}? No one."
puts "Chuck Norris roundhouse kicks #{$1} so strong that it kills all his siblings too."
ObjectSpace.each_object(ObjectSpace.const_get($1)) {|o| o = nil}
def self.inherited(subclass)
puts "Understand me, #{subclass}, no one inherits from Chuck Norris, no one."
raise "CannotSubClassTheChuckNorris"
You can’t perform that action at this time.