Socket
Book a DemoInstallSign in
Socket

toffee

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toffee

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

= Toffee

Candy for your "puts"-debugging!

= Usage

Put the method call: "d" (almost) anywhere in your code to print out debug information:

['a', 'b', 'c'].d.first.d.upcase.d

will print out:

["a", "b", "c"] "a" "A"

"d" always returns self, so it will not interfere or do any harm.

== Configure the output (optional)

Write to standard output (default):

Toffee.configure(STDOUT)

or

Toffee.configure(:stdout)

Write to any object that implements ":puts":

Toffee.configure(IO.new(2, 'w'))

Write to any object that implements ":debug":

Toffee.configure(Rails.logger)

Write to any object that implements the second parameter:

Toffee.configure(Rails.logger, :info)

Write to file using the shell command:

$ echo "my output here" > /tmp/foo.log

Toffee.configure('/tmp/foo.log')

== Options

:timestamp Turn on timestamps with true, turn if off with nil or false; to use a custom timestamp format, pass a string with a Time.strftime kind of format

== Copyright

Copyright (c) 2010 Christoph Petschnig. See LICENSE for details.

Inspiration and parts of the code taken from Jan Lelis (http://github.com/janlelis/zucker)

FAQs

Package last updated on 16 Aug 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.