README.md in hashr-0.0.5 vs README.md in hashr-0.0.6

- old
+ new

@@ -1,13 +1,15 @@ +[![Build Status](https://secure.travis-ci.org/svenfuchs/hashr.png)](http://travis-ci.org/svenfuchs/hashr) + # Hashr Hashr is a very simple and tiny class derived from Ruby's core Hash class which makes using nested hashes for configuration (and other purposes) easier and less repetive and error prone. It supports the following features: * method read and write access -* automatic predicate (boolean, i.e. ?) methods +* automatic predicate (boolean, i.e. `?`) methods * easy defaults * easy inclusion of modules into nested hashes * automatic symbolized keys ## Usage @@ -20,23 +22,23 @@ config.foo # => { :bar => 'bar' } config.foo.bar? # => true config.foo.bar # => 'bar' - config.foo.bar = 'BAR' - config.foo.bar # => 'BAR' + config.foo.bar = 'bar!' + config.foo.bar # => 'bar!' config.foo.baz = 'baz' config.foo.baz # => 'baz' -Be aware that by default missing keys won't raise a method missing error but instead behave like Hash access: +Be aware that by default missing keys won't raise an exception but instead behave like Hash access: config = Hashr.new config.foo? # => false config.foo # => nil -You can make Hashr to raise an IndexError though like this: +You can make Hashr to raise an `IndexError` though like this: Hashr.raise_missing_keys = true config = Hashr.new config.foo? # => false config.foo # => raises an IndexError "Key :foo is not defined." @@ -96,5 +98,16 @@ # going through bundler bundle exec rake # using just ruby ruby -rubygems -Ilib:test test/hashr_test.rb + +## Other libraries + +You also might want to check out OpenStruct and Hashie. + +* [OpenStruct](http://ruby-doc.org/stdlib/libdoc/ostruct/rdoc/classes/OpenStruct.html) does less but comes as a Ruby standard library. +* [Hashie](https://github.com/intridea/hashie) has a bunch of support classes (like `Mash`, `Dash`, `Trash`) which all support different features that you might need. + +## License + +[MIT License](https://github.com/svenfuchs/hashr/blob/master/MIT-LICENSE)