An open API service indexing awesome lists of open source software.

https://github.com/bsmth/hashpipe

Pipe your Ruby hashes here!
https://github.com/bsmth/hashpipe

Last synced: about 1 year ago
JSON representation

Pipe your Ruby hashes here!

Awesome Lists containing this project

README

          

# Hashpipe

This gem is a simple command line utility that formats and colorizes ruby hashes.
Pipe hashes to this little gem and bask in the formatted, colorized glory!

## Installation

Install using rubygems:

$ gem install hashpipe

You can add it to your application's Gemfile if you're that way inclined:

```ruby
gem 'hashpipe'
```

## Usage

If you `.inspect` or console log a hash, pipe it directly to hashpipe like so:

```ruby
# myscript.rb
myhash.inspect
```

$ ruby myscript.rb | hashpipe

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hashpipe. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## Acknowledgments

This gem relies heavily on Norman Clarke's [Hash Formatter](https://github.com/norman/hash_formatter) which is a standard Ruby library.
The only additions here are the colorization using escape sequences and that it is bundled as a Rubygem for easy install and use on the command line.

**Norman Clarke's acknowledgments:**

>It uses [Ruby Parser](https://github.com/seattlerb/ruby_parser) and [Ruby2Ruby](https://github.com/seattlerb/ruby2ruby) rather than regular expressions, letting it parse even the trickiest Ruby code with ease.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the Hashpipe project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/hashpipe/blob/master/CODE_OF_CONDUCT.md).