pretty
pretty.cr 
Something pretty
stuff for Crystal.
- crystal: 0.23.1
Features
Pretty.lines
: formatsArray(Array(String))
as table-like text.Pretty.json
: formats JSON string
Installation
Add this to your application's shard.yml
:
dependencies:
pretty:
github: maiha/pretty.cr
version: 0.2.0
Usage
require "pretty"
lines : String
- args:
(lines : Array(Array(String)), indent : String = "", delimiter : String = "")
array = [
["user", "maiha"],
["password", "123"],
]
Pretty.lines(array, delimiter: " = ")
# user = maiha
# password = 123
json : String
- args:
(json : String, color : Bool = false)
json = %({"id": "123", "name": "maiha"})
Pretty.lines(json)
# {
# "id": "123",
# "name": "maiha"
# }
Development
make
Contributing
- Fork it ( https://github.com/maiha/pretty.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- maiha maiha - creator, maintainer