Sha256: 861fe69b729edd43436fee1e396907d15af2a9cd3a49b9d1dbbede013c4954f9

Contents?: true

Size: 737 Bytes

Versions: 4

Compression:

Stored size: 737 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 } unless message.frozen?
      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 } unless message.frozen?
        STDERR.puts message
      end
      exit 1
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
main-6.3.0 lib/main/stdext.rb
main-6.2.3 lib/main/stdext.rb
main-6.2.2 lib/main/stdext.rb
main-6.2.1 lib/main/stdext.rb