README.md in basket-0.0.3 vs README.md in basket-0.0.4

- old
+ new

@@ -24,11 +24,11 @@ ## Usage Add items to your basket as they come along. They might come along quickly, or there might be a delay between them. Regardless, you want to collect items into your basket before going and doing something with them. ```ruby -while chicken.laying do +while chicken.laying? do egg = { egg: {color: brown, size: medium}} Basket.add('QuicheBasket', egg) end ``` @@ -87,29 +87,39 @@ ## Configuration In an initializer, or somewhere equally appropriate, you might put something like this: ```ruby -Basket.config do |config| +Basket.configure do |config| config.redis_host = "127.0.0.2" config.redis_port = 6390 config.redis_db = 10 config.backend = :redis config.namespace = :basket end ``` -The defaults for a redis backend are the standard "127.0.0.1", 6379, 15 with a namespace of :basket. +The defaults for a redis backend are the standard `"127.0.0.1"`, `6379`, `15` with a namespace of `:basket`. The default for the backend is the HashBackend, which can be set by passing `:hash` to `config.backend`, but you don't have to do that. Because it's the default! +For the redis configuration, you can alternatively pass a url, thusly: + +```ruby +Basket.configure do |config| + config.backend = :redis + config.redis_url = "redis://:p4ssw0rd@10.0.1.1:6380/15" +end +``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` 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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). This project uses Guard to facilitate local development. You can run it with `bundle exec guard`. It will run specs on change to files and will run `standard --fix` after passing tests. + +Looking through the code base, the majority of the work happens in [lib/basket/handle_add.rb](https://github.com/nicholalexander/basket/blob/main/lib/basket/handle_add.rb). Alternatively, you might be interested in the [backend adapters](https://github.com/nicholalexander/basket/tree/main/lib/basket/backend_adapter) for how the gem works with in memory hashes and/or a redis backend. ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/nicholalexander/basket. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/nicholalexander/basket/blob/main/CODE_OF_CONDUCT.md).