Socket
Book a DemoInstallSign in
Socket

marked

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marked

1.2.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

Marked

    "You stroll with this intelligence
    in and out of fields of knowledge, getting always
    more marks on your preserving tablets.
    There is another kind of tablet, one
    already completed and preserved inside you.
    This second knowing is a fountainhead
    from within you, moving out"
        -- Rumi

DESCRIPTION

Ruby debugging often consists of printing out objects at various points in your code to inspect their current values. Do it fast and easy with Marked. the mark() method exists in global scope and always returns the values you pass into it, allowing your code to run as normal but giving you intermediate feedback.

USAGE

Before:

class User < ActiveRecord::Base
  def some_method
    complex_result.with_chaining( omg.I_lost_track )
  end
end

How do you tell what the value of complex_result is inside this method? How do you tell if this method even ran? You write tests. Okay, but after that, if you're tracking down a bug?

class User < ActiveRecord::Base
  def some_method
    complex_result.with_chaining( mark omg.I_lost_track )
  end
end

And you'll get the value of complex_result printed to your console and to the Rails log (if it exists)

MARKED /code/my_file:5
       "omg.I_lost_track contents"

Can take multiple arguments, always returning the last:

class User < ActiveRecord::Base
  def some_method
    mark self, 'complex result: ', complex_result
  end
end

Also handles blocks smoothly, returning the block's result as if there were no block.

class User < ActiveRecord::Base
  def some_method
    mark self, 'complex result: ' do
      complex_result
    end
  end
end

INSTALL

* gem install marked

Copyright 2011 Jack Danger Canty. Patches welcome, forks celebrated

FAQs

Package last updated on 15 Sep 2011

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.