Sha256: 9c0c5aeb2f366d5107175a50f33bc2262440249bfbfbbaa755e60a6262c55a25

Contents?: true

Size: 691 Bytes

Versions: 30

Compression:

Stored size: 691 Bytes

Contents

class Object
  def singleton_class(object = self, &block)
    singleton_class =
      class << object
        self
      end
    block ? singleton_class.module_eval(&block) : singleton_class
  end
end

module Kernel
private
  undef_method 'abort'
  def abort(message = nil)
    if message
      message = message.to_s
      message.singleton_class{ fattr 'abort' => true }
      STDERR.puts message
    end
    exit 1
  end
end

module Process
  class << Process
    undef_method 'abort'
    def abort(message = nil)
      if message
        message = message.to_s
        message.singleton_class{ fattr 'abort' => true }
        STDERR.puts message
      end
      exit 1
    end
  end
end

Version data entries

30 entries across 29 versions & 2 rubygems

Version Path
main-4.7.1 lib/main/stdext.rb
main-4.7.0 lib/main/stdext.rb
main-4.6.0 lib/main/stdext.rb
main-4.4.0 lib/main/stdext.rb
main-4.3.0 lib/main/stdext.rb
main-4.2.0 lib/main/stdext.rb
main-4.0.0 lib/main/stdext.rb
main-3.0.3 lib/main/stdext.rb
main-3.0.2 lib/main/stdext.rb
main-3.0.1 lib/main/stdext.rb