To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!
More about adding a collaboratorPretty-print with source location
Kernel#qql works just like Kernel#pp from the built-in pp library,
except that it writes to $stderr and it labels the output with
the source location.
If the filename is long, then the source location is printed on a
line of its own.
- Scenarios
-
- One argument
-
- Given
-
a file named "example.rb" with:
require "cute_print" a = [ "Once upon a time there were four little Rabbits, ", "and their names were", "Flopsy,", "Mopsy,", "Cotton-tail, and", "Peter.", ] qql a
- Then
-
stderr should be
example.rb:10: ["Once upon a time there were four little Rabbits, ", "and their names were", "Flopsy,", "Mopsy,", "Cotton-tail, and", "Peter."]
- Two arguments
-
- Given
-
a file named "example.rb" with:
require "cute_print" qql 1, "foo"
- Then
-
stderr should be
example.rb:2: 1 example.rb:2: "foo"
- Very long label
-
- Given
-
a file named "long____________________________filename.rb" with:
require "cute_print" a = [ "Once upon a time there were four little Rabbits, ", "and their names were", "Flopsy,", "Mopsy,", "Cotton-tail, and", "Peter.", ] qql a
- Then
-
stderr should be
long____________________________filename.rb:10: ["Once upon a time there were four little Rabbits, ", "and their names were", "Flopsy,", "Mopsy,", "Cotton-tail, and", "Peter."]
Last published over 7 years ago by Wayne Conrad.