Skip to content
A console to edit and maintain YAML files for any Ruby project
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

mayl - a YAML console

Mayl is an anagram of YAML, and also an interactive console to create, edit and maintain YAML files in any kind of Ruby projects.



Install mayl yourself:

$ gem install mayl


Mayl expects your YAML files to be organized like this: one file per locale (en.yml, es.yml, ca.yml...) in a directory.

When it starts, it needs to know where to find all these YAML files, and it looks by default under ./config/locales but you can always run it like mayl some/other/dir to override this.

$ mayl
Detected locales: ca, en, es

Now we'll set a new key by typing set KEY and typing in the translations:

> set
  ca: Article
  en: Post
  es: Artículo

  Set to Article (ca), Post (en) and Artículo (es)

Changes get written to the file immediately. We can consult a key any time, and in case we see any error, correct it quickly with edit LOCALE NEWVALUE:

> get
  ca: Article
  en: Post
  es: Artículo
> edit es Entrada

  Set to Entrada (es)


If you want to work for a while inside a namespace, let's say activerecord.models, you can do so by cd-ing into it, and even ls the existing keys:

> cd activerecord.models
activerecord.models > get post
  ca: Article
  en: Post
  es: Entrada
activerecord.models > cd ..
activerecord > ls
models attributes
activerecord > cd ..

Cool way to navigate your YAML files huh?

Other useful commands

  • exit: Exits the console.


To run the tests:

$ rake

To build the documentation under the doc directory:

$ rake doc


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Who's this

This was made by Josep M. Bach (Txus) under the MIT license. I'm @txustice on twitter (where you should probably follow me!).

Something went wrong with that request. Please try again.