= cutter

For now it is two-methods-gem I use a lot for simple debugging & performance measuring purposes.
Include it into Gemfile:
  gem 'cutter'

Methods are:

==I) #inspect! 

Insert #inspect! method into any of your methods:
  def your_method *your_args
    inspect! {} # this string exactly!    
    ...
  end

  your_method(1,"foo",:bar) => 
    method `your_method'
      variables: 
        args: [1, "foo", :bar]

or in more rigorous way:

  def your_another_method(first, second, third, &block)
    inspect!(binding)
  end
  
  your_another_method(1,"foo",:bar) => 
    method `your_another_method'
      variables: 
        first: 1
        second: "foo"
        third: :bar
        block: 


Gives simple but nice trace for inspection: method's name and args that were passed to method

If you want all #inspect! methods fall silent at once, use
  Cutter::Inspection.quiet!
To make them sound again do
  Cutter::Inspection.loud!

You can clone it and try bundle exec rspec spec/inspection/demo_spec. Very! Very simple!

==II) #stamper
    def your_method
      stamper("testing pieces of code") do
        piece_of_code #1
        stamp("piece #1 performed!")
        piece_of_code #2
        stamp("piece #2 performed!")
        pirce_of_code #3
      end
    end

    your_method => 
    ~ testing pieces of code 
    ~ testing: start
    ~ testing: piece #1 performed!, 10ms
    ~ testing: piece #2 performed!, 231ms
    ~ testing: end (247ms)

    
    or simply:
    def test_method
      stamper {
        piece of code
      }
    end

Acts as self.benchmark{} (in Rails) or Benchmark.measure{} (common Ruby) but with stamps in any position in block executed.
It is much simpler to write it quickly than all these Measure-dos.

== Contributing to cutter
 
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
* Fork the project
* Start a feature/bugfix branch
* Commit and push until you are happy with your contribution
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

== Copyright

Copyright (c) 2011 Stanislaw Pankevich. See LICENSE.txt for
further details.