README.md in cutter-0.8.7 vs README.md in cutter-0.8.8
- old
+ new
@@ -2,19 +2,19 @@
Two-methods-gem I use a lot for simple debugging & performance measuring purposes.
```#inspect``` method shines when doing reverse engineering, it is especially useful, when it is needed to quickly hack on someone else's code. Also, it is very easy to become 'someone else' for self, when dealing with own code, if it was written very long time ago.
-Besides that ```#stamper``` allows doing some performance measuments in a handy manner, it can be used to create quick and neat demonstrations of how particular pieces of Ruby code perform.
+Besides that ```#stamper``` allows doing performance measuments in a handy manner, it can be used to create quick and neat demonstrations of how particular pieces of Ruby code perform.
-The one interesting possible usage of ```#stamper``` is to optimize performance of templates on Rails View layer, because it often takes a large (compared to M and C layers) load impact because of Rails lazy-evaluation mechanisms.
+The one interesting possible usage of ```#stamper``` is performance optimization of templates on Rails View Layer, because it often takes a large load impact (compared to M and C layers) because of Rails lazy-evaluation mechanisms.
[](http://travis-ci.org/stanislaw/cutter)
## Prerequisites
-It works on 1.8.7, 1.9.3, JRuby and Rubinius
+It works on 1.8.7, 1.9.3, JRuby and Rubinius.
## Installiation
Include it into Gemfile:
@@ -23,10 +23,11 @@
gem 'cutter'
end
```
## Cutter::Inspection
+
### I) #inspect!
Insert ```#inspect!``` method into any of your methods:
```ruby
@@ -165,28 +166,30 @@
end
```
### #iii
-Instead of ```#inspect!``` you can use ```#iii``` - just an alias more convenient for typing. Finally, you have a group of 4 three-letters methods in your every day debugging workflow.
+Instead of ```#inspect!``` you can use ```#iii``` - just an alias more convenient for typing.
+Finally, you have a group of 4 three-letters methods in your every day debugging workflow.
+
## II) Cutter::Stamper
-Acts as ```benchmark {}``` in Rails or ```Benchmark.measure {}``` (common Ruby) but with stamps in any position in block executed.
+Acts as ```benchmark {}``` in Rails or ```Benchmark.measure {}``` in common Ruby, but with stamps in any position in block executed.
It is much simpler to write Stamper with Stamps than all these Measure-dos.
### Minimal stamper
-```stamp!``` method is just an alias for ```stamp```, use whatever you like.
+```stamp!``` method is just an alias for ```stamp```, use whatever you like:
```ruby
puts "Minimal stamper"
-stamper do |s|
+stamper do
stamp
sleep 0.2
- stamp!
+ stamp!
sleep 0.2
stamp!
end
```
@@ -218,11 +221,12 @@
i.msg first: "I'm the first inner stamp"
end
stamper :testing_method do |tm|
sleep 0.3
- tm.stamp! :_1
+ tm.stamp! :_1 # The old form of calling #stamp! on yielded scope
+ variable
sleep 0.3
stamper :inner_scope do |i|
sleep 0.2
i.stamp! :first
sleep 0.2
@@ -253,10 +257,10 @@
1001ms
```
## Notes
-* Both ```#inspect! {}``` and ```#stamper``` method colorize their output. You can see ```lib/cutter/colored_output.rb``` file to understand how it is done. I will really appreciate any suggestions of how current color scheme can be improved.
+* Both ```#inspect! {}``` and ```#stamper``` methods colorize their output. You can see ```lib/cutter/colored_output.rb``` file to understand how it is done. I will really appreciate any suggestions of how current color scheme can be improved.
## Specs and demos
Clone it