There are two ruby on rails internationalization yaml files. One file is complete and another one is with missing keys. How can I compare two yaml files and see missing keys in
I couldn't find a fast tool to do that. I decided to write my own tool for this.
You can install it with cabal:
$ cabal update
$ cabal install yamlkeysdiff
Then you can diff two files this way:
$ yamlkeysdiff file1.yml file2.yml
> missing key in file2
< missing key in file1
You can also compare two subsets of the files:
$ yamlkeysdiff "file1.yml#key:subkey" "file2.yml#otherkey"
It behaves exactly like diff
, you can do this:
$ yamlkeysdiff file1.yml file2.yml && echo Is the same || echo Is different