README.md in pretty_feed-0.1.1 vs README.md in pretty_feed-0.2.0

- old
+ new

@@ -1,11 +1,9 @@ # PrettyFeed PrettyFeed is a modulizer you can include in a job, worker, class, rake task, etc, which allows for simple pass/fail logging colorization. Defaults are `truthy: 'green'` and `falsey: 'red'`. -If `ColorizedString` (from the [`colorize` gem](https://github.com/fazibear/colorize) is defined it will use that. It is preferred because it doesn't pollute the `String` class with color methods. Alternatively, it will work with strings that respond to the colors you select as methods on the `String` instance. This means it should work with `colored2`, `awesome_print`, and many other similar gems. If your strings do not respond to color methods there will be a `warn` message printed to STDERR. Colors available depend on the gem you use to provide the color methods! - While this gem has no direct dependencies, it won't accomplish do much for you unless you are using a "console output coloring" gem of some kind. ## Installation Install the gem and add to the application's Gemfile by executing: @@ -21,13 +19,13 @@ ```ruby namespace :scrub do task :blurb => :environment do |_t, _args| include PrettyFeed::PfTf.new(truthy: 'green', falsey: 'blue') pftf("this will be green", true) - # => "this will be green" # in the console + # => "this will be green: true" # in the console pftf("this will be blue", false) - # => "this will be blue" # in the console + # => "this will be blue: false" # in the console end end ``` Instead of passing truthy or falsey values, you can pass a proc that will be evaluated with the value passed to it as an argument. @@ -35,13 +33,23 @@ ```ruby namespace :scrub do task :blurb => :environment do |_t, someth| include PrettyFeed::PfTf.new(truthy: 'green', falsey: 'blue') pftf("might be green or blue", someth, ->(a) { a }) - # => the color will depend on what someth is and how the proc evaluates it. + # => "might be green or blue: #{someth}" # in the console + # NOTE: the color will depend on what someth is and whether the proc evaluates as truthy or falsey. end end ``` + +### Defaults + +`ColorizedString` (from the [`colorize` gem](https://github.com/fazibear/colorize)) will be used if it is `defined?`. I prefer it because it doesn't pollute the `String` class with color methods. + +### Options + +It will also work with strings that respond to the colors you select as methods on the `String` instance. This means it should work with `colored2`, `awesome_print`, and many other similar gems. If your strings do not respond to color methods there will be a `warn` message printed to STDERR. Colors available depend on the gem you use to provide the color methods! The various gems do not have uniform sets of colors, nor names of colors. + ## 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. \ No newline at end of file