Sha256: c252231866c662a5993cfe882cd88ae90efb0482cdad9df3f8da87d90c808f7d

Contents?: true

Size: 721 Bytes

Versions: 11

Compression:

Stored size: 721 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

11 entries across 11 versions & 4 rubygems

Version Path
ThiagoLelis-backgroundjob-1.0.4 lib/main/stdext.rb
ahoward-main-2.9.0 lib/main/stdext.rb
vibes-bj-1.2.2 spec/rails_root/vendor/plugins/bj/lib/main/stdext.rb
vibes-bj-1.2.1 spec/rails_root/vendor/plugins/bj/lib/main/stdext.rb
main-2.9.3 lib/main/stdext.rb
main-2.9.2 lib/main/stdext.rb
main-2.9.0 lib/main/stdext.rb
main-2.8.2 lib/main/stdext.rb
main-2.8.1 lib/main/stdext.rb
main-2.8.4 lib/main/stdext.rb
main-2.8.3 lib/main/stdext.rb