Sha256: 2826f808e7ad03888dbbfc6052da6dff36e5c3bb46bd0371dfe3e1c16802c4ca

Contents?: true

Size: 733 Bytes

Versions: 3

Compression:

Stored size: 733 Bytes

Contents

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

end

module SaneAbort
  def abort message = nil
    if message
      message = message.to_s
      message.singleton_class{ attribute 'abort' => true }
      STDERR.puts message
    end
    exit 1
  end
end

  def abort message = nil
    if message
      message = message.to_s
      message.singleton_class{ attribute 'abort' => true }
      STDERR.puts message
    end
    exit 1
  end
  def Process.abort message = nil
    if message
      message = message.to_s
      message.singleton_class{ attribute 'abort' => true }
      STDERR.puts message
    end
    exit 1
  end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
main-2.6.0 lib/main/stdext.rb
main-2.8.0 lib/main/stdext.rb
main-2.7.0 lib/main/stdext.rb