pretty
pretty.cr 
Something pretty
stuff for Crystal.
- crystal: 0.23.1
API
Pretty.lines(lines : Array(Array(String)), indent : String = "", delimiter : String = "")
Pretty.json(json : String, color : Bool = false)
Pretty::Time.parse(value : String)
Installation
Add this to your application's shard.yml
:
dependencies:
pretty:
github: maiha/pretty.cr
version: 0.3.1
Then require it in your app.
require "pretty"
Usage(lines)
Pretty.lines(args) : String
array = [
["user", "maiha"],
["password", "123"],
]
Pretty.lines(array, delimiter: " = ")
user = maiha
password = 123
Usage(json)
Pretty.json(args) : String
str = %({"id": "123", "name": "maiha"})
Pretty.json(str)
{
"id": "123",
"name": "maiha"
}
Usage(time)
Pretty::Time.parse(args) : Time
aka. Pretty.time
Pretty.time("2000-01-02") # => 2000-01-02 00:00:00 UTC
Pretty.time("2000-01-02 03:04:05") # => 2000-01-02 03:04:05 UTC
Pretty.time("2000-01-02 03:04:05.678") # => 2000-01-02 03:04:05 UTC
Pretty.time("2000-01-02T03:04:05.678+09:00") # => 2000-01-02 03:04:05 +0900
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