pretty

Something attentive, conservative and pretty stuff utility backward-compatibility
0.2.0 released
maiha/pretty.cr
16
maiha

pretty.cr Build Status

Something pretty stuff for Crystal.

  • crystal: 0.23.1

Features

  • Pretty.lines : formats Array(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

  1. Fork it ( https://github.com/maiha/pretty.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • maiha maiha - creator, maintainer
pretty:
  github: maiha/pretty.cr
  version: ~> 0.2.0
License MIT
Crystal none

Authors

Dependencies 0

Development Dependencies 0

Dependents 9

Last synced .
search fire star recently