Spp
spp
is super pretty print library.
It is useful for log output etc.
Installation
Add this line to your application's Gemfile:
gem 'spp'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install spp
Usage
How to use spp is easy.
Spp::spp('hoge')
=>
========== START ==========
"hoge"
========== E N D ==========
# same as below
# puts "========== START =========="
# pp 'hoge'
# puts "========== E N D =========="
You can also specify modifiers with arguments.
Spp::spp('hoge', 'start', 'end', 'π' * 5)
=>
πππππ start πππππ
"hoge"
πππππ end πππππ
You can also pass the block and take the benchmark.
Spp::spp_bench('start', 'end', 'π' * 5) do
# some kind of processing
end
=>
πππππ start(2018-08-09 08:41:09.821 +0900) πππππ
"hoge"
πππππ end(2018-08-09 08:41:12.821 +0900) πππππ
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Madogiwa0124/spp. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Spp projectβs codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.