Sha256: b42d66b14a0549bd9e5c6bb480dd1538e1dface17064afcc05df850d85f34f2a

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

Tick
=====

About 
------

Tick benchmark your method and print benchmark in color  


Installation 
-------

    gem install tick 


Usge 
--------

    def foo 
    end 
    tick :foo  


Configuration 
-------------

By default you don't need any configuration.


Enable tick:

    Tick.enabled = true 

default: true

Whether print benchmark in color 

    Tick.color = true 

default: true

Logger:
    
    Tick.logger = Logger.new(STDOUT) 

default: Rails.logger if in Rails environment otherwise Logger.new(STDOUT)

Customize messages:

    Tick.desc_message = lambda { |class_name, method_name| "TIME c:#{class_name} m:#{method_name}" }
    Tick.time_message = lambda { |sec| "COST (#{sec})" }

Default: 
* desc_message: "TICK: method '#{method_name.to_s}' in class '#{self.class.name}'" 
* time_message: "(#{sec.to_s} ms)"


Set 256 color:

    Tick.desc_color = "#FFC482"
    Tick.time_color = "#FFC482"

Default:
*  desc_color: yellow 
*  time_color: cyan


Special Thanks To
-----------------

* sickill's rainbow gem 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tick-0.1.0 README.md