No commit activity in last 3 years
A long-lived project that still receives updates
Allows you to deep sort YAML files that are mainly composed of nested hashes and string values. Great to sort your rails I18n YAML files. You can easily add it to a textmate bundle, rake task, or just use the included regular comand line tool.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

i18n_yaml_sorter

Build Status Gem Version

History

This is a fork of https://github.com/redealumni/i18n_yaml_sorter and the original works just fine. :)

Purpose

Large yaml files can be frustrating to navigate. This helps. This is intended to specifically work with the YAML Hash keys commonly used by the i18n gem and rails apps.

This does not parse YAML, it just sorts the lines.

Usage

gem install i18n_yaml_sorter_2
sort_yaml < in.yml > out.yml
mv out.yml in.yml

or

require 'i18n_yaml_sorter'
I18nYamlSorter::Sorter.new(File.open('path/to/file.yml'))  

Textmate Bundle

Run this command in the Terminal to install it:

$ sort_yaml -i

A TextMate bundle, named "Yaml Sort" will be installed in your user home path. Press "Shift+Command+S" or use the Bundles menu to invoke it. The opened yaml file (or just the part of it that is selected) will be sorted. To edit the selected part of the file, make sure it is valid YAML by itself, or your yaml file might be corrupted (you can always Undo if you mess up).

Rails Rake Task

Declare it as a dependency in your app Gemfile, under the development group:

gem 'i18n_yaml_sorter_2', :group => :development

Run bundle install under your Rails' app:

$ bundle install

Now run the rake task under your Rails' app to sort all the i18n files in your config/locales dir:

$rake i18n:sort

Development

rake spec # run tests
rake release # build installable/publishable gem

Copyright

Copyright (c) 2010-2011 Bernardo de Pádua. MIT License (See LICENCE).

Contributing

  1. Fork it ( https://github.com/[my-github-username]/aws_agcod/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