All Projects → yegor256 → Backtrace

yegor256 / Backtrace

Ruby gem to print exception backtrace nicely

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Backtrace

React on rails
Integration of React + Webpack + Rails + rails/webpacker including server-side rendering of React, enabling a better developer experience and faster client performance.
Stars: ✭ 4,815 (+34292.86%)
Mutual labels:  ruby-gem
Forty Jekyll Theme
A Jekyll version of the "Forty" theme by HTML5 UP.
Stars: ✭ 695 (+4864.29%)
Mutual labels:  ruby-gem
Groovehq
Ruby gem for GrooveHQ api
Stars: ✭ 22 (+57.14%)
Mutual labels:  ruby-gem
Jekyll Theme Basically Basic
Your new Jekyll default theme
Stars: ✭ 524 (+3642.86%)
Mutual labels:  ruby-gem
Mobility
Pluggable Ruby translation framework
Stars: ✭ 644 (+4500%)
Mutual labels:  ruby-gem
Bugsnag Laravel
Bugsnag notifier for the Laravel PHP framework. Monitor and report Laravel errors.
Stars: ✭ 746 (+5228.57%)
Mutual labels:  exceptions
Termit
Translations with speech synthesis in your terminal as a ruby gem
Stars: ✭ 505 (+3507.14%)
Mutual labels:  ruby-gem
Data mining
The Ruby DataMining Gem, is a little collection of several Data-Mining-Algorithms
Stars: ✭ 10 (-28.57%)
Mutual labels:  ruby-gem
Nokogiri
Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
Stars: ✭ 5,748 (+40957.14%)
Mutual labels:  ruby-gem
Omniauth Pge
OmniAuth Strategy for PG&E
Stars: ✭ 6 (-57.14%)
Mutual labels:  ruby-gem
Ransack
Object-based searching.
Stars: ✭ 5,020 (+35757.14%)
Mutual labels:  ruby-gem
Bugsnag Js
Javascript error handling tool for Bugsnag. Monitor and report JavaScript bugs & errors.
Stars: ✭ 625 (+4364.29%)
Mutual labels:  exceptions
Finite machine
A minimal finite state machine with a straightforward syntax.
Stars: ✭ 772 (+5414.29%)
Mutual labels:  ruby-gem
Facebook data analyzer
Analyze facebook copy of your data with ruby language. Download zip file from facebook and get info about friends ranking by message, vocabulary, contacts, friends added statistics and more
Stars: ✭ 515 (+3578.57%)
Mutual labels:  ruby-gem
Gitlab
Ruby wrapper and CLI for the GitLab REST API
Stars: ✭ 939 (+6607.14%)
Mutual labels:  ruby-gem
Traceback with variables
Adds variables to python traceback. Simple, lightweight, controllable. Debug reasons of exceptions by logging or pretty printing colorful variable contexts for each frame in a stacktrace, showing every value. Dump locals environments after errors to console, files, and loggers. Works in Jupyter and IPython. Install with pip or conda.
Stars: ✭ 509 (+3535.71%)
Mutual labels:  exceptions
Truemail
🚀 Configurable framework agnostic plain Ruby 📨 email validator/verifier. Verify email via Regex, DNS and SMTP. Be sure that email address valid and exists.
Stars: ✭ 717 (+5021.43%)
Mutual labels:  ruby-gem
Tty Which
Cross-platform implementation of Unix `which` command
Stars: ✭ 11 (-21.43%)
Mutual labels:  ruby-gem
Sosl
StackOverflow Search Library
Stars: ✭ 10 (-28.57%)
Mutual labels:  exceptions
Pastebin
Just another Pastebin.com CLI script, but you can even login with your user account.
Stars: ✭ 5 (-64.29%)
Mutual labels:  ruby-gem

DevOps By Rultor.com We recommend RubyMine

Build Status Gem Version Maintainability Yard Docs Hits-of-Code

License

A Ruby backtrace nicely printed.

First, install it:

$ gem install backtrace

Then, use it like this, to print a backtrace:

require 'backtrace'
begin
  # do something dangerous
rescue StandardError => e
  puts Backtrace.new(e)
end

screenshot

A more compact version would use a block:

require 'backtrace'
Backtrace.exec(swallow: true) do
  # do something dangerous
end

You can also provide a logging facility, to log the backtrace:

require 'backtrace'
log = Log.new # it must implement method error(msg)
Backtrace.exec(swallow: true, log: log) do
  # do something dangerous
end

Sometimes you may need to hide unimportant lines of the backtrace, which are not related to your code base. You can use mine argument of the constructor, which is a regular expression or a string. When it's met in the backtrace, the printing will stop:

require 'backtrace'
begin
  # do something dangerous
rescue StandardError => e
  puts Backtrace.new(e, mine: 'yegor')
end

That's it.

How to contribute

Read these guidelines. Make sure you build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:

$ bundle update
$ bundle exec rake

If it's clean and you don't see any error messages, submit your pull request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].