Guard::Yamlsort alphabetically sorts keys in yaml files when a modification is detected.
- The Guard rubygem.
- Ruby 1.9.2 or higher.
Add guard-yamlsort to your Gemfile (inside development group):
gem 'guard-yamlsort'
Install or update your bundle:
bundle install
Add the default guard-yard definition to your Guardfile:
guard init yamlsort
guard 'yamlsort' do
watch(%r{^config/locales/.+\.yml})
end