# Pears Welcome to the readme of Pears. This library is used to consume configuration in Ruby applications in a cascading way. It is named Pears because its a short, rememberable word and wasn't taken on rubygem. ## Installation Add this line to your application's Gemfile: ```ruby gem 'pears' ``` And then execute: $ bundle install Or install it yourself as: $ gem install pears ## Usage Configuration is loaded via the provider setting. ## Terminology - A Subject is a grouping of configuration items with a single interface - A Subject contains at least a single "Layer" that wraps a "Provider" - A Provider is an adapter(YAML OR REDIS). - That wraps it up ##### Providers: - LocalFile - read a yaml file identified by a path into a "Subject" - RemoteFile - read a yaml file identified by a URI into a "Subject" - Subscription - Read a yaml file identified by a URI as a segment and update it whenever the the provided redis channel gets an update. - ENV - read the ENV and overwrite keys found on lower layers of the segment. ** - LOCO - read a loco file into a segment. ** ** Nice to have ## Todo - Figure out if subscription should be a providerof maybe something else. - Add Loco as a provider. - Add ENV as a provider. - Add Redis as a provider. - Figure out if there is a sensible tie in with kubernetes. - Add support for different file-types. - Add different ways to trigger updates from redis subscriptions. (like hand fired events?) ## 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). ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pears. ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).