Project

djan

0.0
The project is in a healthy, maintained state
Pretty pretting for floraison and flor.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 5.0

Runtime

~> 1.0
 Project Readme

djan

tests Gem Version

Pretty pretting for floraison and flor. A bit loose like JS and YAML.

Meant for readable output, not for input.

require 'djan'

Djan.to_dnc("papa tango charly")  # -->
  "\"papa tango charly\""
Djan.to_dnc({:a=>"abc"})  # -->
  "{ a: abc }"
Djan.to_dnc([1, 2, "three"])  # -->
  "[ 1, 2, three ]"

options

Djan.to_d(x, width: 40)
  # set max width to 40 chars

Djan.to_d(x, width: :console)
Djan.to_d(x, width: true)
  # use console width

Djan.to_d(x, color: false)
Djan.to_d(x, colour: false)
Djan.to_d(x, colors: false)
Djan.to_d(x, colours: false)
Djan.to_dnc(x)
  # output without colours

LICENSE

MIT, see LICENSE.txt