Sha256: 4b11646dba3838c69cf4fcb3d6c45064a315121517e337c57efe8f2889313dfc

Contents?: true

Size: 759 Bytes

Versions: 2

Compression:

Stored size: 759 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{ fattr 'abort' => true }
      STDERR.puts message
    end
    exit 1
  end
end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ThiagoLelis-backgroundjob-1.0.5 lib/main/stdext.rb
ThiagoLelis-backgroundjob-1.0.6 lib/main/stdext.rb