Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

bgreg/humanist-errors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

121 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code ClimateTest CoverageBuild Status

Error messages for Humans.

Join the chat at https://gitter.im/bgreg/humanist-errors

Humanist errors is a system for extending ruby exception messages. It will prepend the standard output with text defined in the humanist errors dictionary that hopefully explains what is going on a little better.

Some examples:

img img

Installation

Add this line to your application's Gemfile:

gem 'humanist-errors'

And then execute:

$ bundle

Or install it yourself as:

$ gem install humanist-errors

Usage

You can use humanist errors globally in your project, or only around specific pieces of code. To use globally:

Require the library and monkey file

require 'humanist_errors'
require 'humanist_errors/monkey'

Thats it! Now when ruby tries to evaluate an error like when you say: 1/0 you will see a new error message.

If you only want to see new errors in an isolated area you can include the library and execute your code inside a special code block.

  1. Add these require statements to your file:

require 'humanist_errors'

require 'humanist_errors/monkey'

  1. Include the humanist errors module:

include HumanistErrors

  1. Then your code in a human block:
	with_human_errors do
      		#....
	end

This gem is intended for use in development and test environments only.

Contributing

  1. Fork it ( https://github.com/bgreg/humanist-errors/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

More readable errors, for humans.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages