README.md in cute_print-0.3.0 vs README.md in cute_print-0.4.0

- old
+ new

@@ -6,18 +6,29 @@ Write debug output to stderr. Optionally print the source filename and line number, or the source of the debug statement. Easily inspect the middle of a call chain. +## Why? + +* You want to print debug output very quickly, and remove it just as + quickly. +* You want to easily label the debug output with the source + location. +* You want to easily label the debug output with the debug + code itself. +* You want to easily debug the middle of a call chain. +* You are debugging a program that is run with stdout redirected. + ## Links * This is a [rubygem](http://rubygems.org/gems/cute_print) * The source is on [github](https://github.com/wconrad/cute_print) * Cucumber-driven documentation is on [relishapp](https://www.relishapp.com/wconrad/cute-print/v/0-2-0/docs) * API docs are at - [rubydoc.info](http://rubydoc.info/gems/cute_print/0.2.0/frames) + [rubydoc.info](http://rubydoc.info/gems/cute_print) ## Installation Add this line to your application's Gemfile: @@ -69,19 +80,37 @@ # 2, # ... # 20, # 30] +When called with a bock, qq prints the debug source as well: + + a = (1..30).to_a + qq {a} # a is [1, + # 2, + # ... + # 20, + # 30] + **qql** also prints the source location: a = (1..30).to_a qq a # foo.rb:12: [1, # 2, # ... # 20, # 30] +When called with a block, qql prints the debug source as well: + + a = (1..30).to_a + qq {a} # foo.rb:12: a is [1, + # 2, + # ... + # 20, + # 30] + **tapq** inspects the middle of a call chain: ["1", "2"].map(&:to_i).tapq.inject(&:+) # [1, 2] @@ -128,9 +157,21 @@ To reset the configuration to its defaults: CutePrint.configure do |c| c.reset end + +## Without modifying Ruby classes + +By default, this gem defines many methods on Object, making them +globally available. To use this gem without any global methods, +require "cute_print/core" and then call one of the CutePrint class +methods: + + require "cute_print/core" + CutePrint.q {1 + 2} # 1 + 2 is 3 + +The "tap" methods are not available when using CutePrint this way. ## Rubies supported This gem is known to work with these Rubies: