Project

formaticon

0.0
No commit activity in last 3 years
No release in over 3 years
Helpers for generating configurations
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Formaticon

Stop re-inventing the configuration file wheel.

Ini

  • Formaticon.ruby_to_ini(hash)

Original ruby:

{
  'default' => {
    'fubar' => true,
    'foobar' => false,
    'fauxbar' => OHAI,
    'foobars' => 3
    'fubars' => 'Lots of them'
  },
  'custom' => {
    'bing' => 'bang'
  }
}

Formatted output:

[default]
fubar = yes
foobar = no
fauxbar = OHAI
foobars = 3
fubars = "Lots of them"
[custom]
bing = "bang"

Xml

  • Formaticon.ruby_to_xml(hash)

Original ruby:

{
  :fubar => {
    :foobar => {
      :@name => 'Fubar',
      :@class => 'So Classy'
      :fauxbar => 'BANG'
    }
  },
  :bing => [
    {
      :@name => 'boom'
    },
    {
      :@name => 'bam'
    }
  ]
}

Formatted output:

<fubar>
  <foobar name="Fubar" class="So Classy">
    <fauxbar>BANG</fauxbar>
  </foobar>
  <bing name="boom"/>
  <bing name="bam"/>
</fubar>

Erlang

  • Formaticon.ruby_to_erl(hash)

Original ruby:

Info