diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-09-06 00:39:14 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-09-06 00:39:14 -0400 |
commit | ac4dcb64a8f6c07dfe50e9005dc4246f21ebf84e (patch) | |
tree | 8d9144bf1ab4c881f076ae2b7927516d764d89e0 /bin/normalize-stdio | |
parent | 4b70501e432eb5fd9ed04a4afbadafabd982e9fc (diff) |
Split hackers.yml into users/#{uid}.yml
Diffstat (limited to 'bin/normalize-stdio')
-rwxr-xr-x | bin/normalize-stdio | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/bin/normalize-stdio b/bin/normalize-stdio deleted file mode 100755 index 23a240e..0000000 --- a/bin/normalize-stdio +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env ruby -require 'yaml' - -core_order = [ "username", - "fullname", - "email", - "groups", - "pgp_keyid", - "pgp_revoked_keyids", - "ssh_keys", - "extra" ] - -extra_order = [ "alias", - "other_contact", - "roles", - "website", - "occupation", - "yob", - "location", - "languages", - "interests", - "favorite_distros" ] - -_core_order = Hash[[*core_order.map.with_index]] -_extra_order = Hash[[*extra_order.map.with_index]] - -print YAML::load(STDIN) - .sort_by{|u| u["username"]} - .map{|u| Hash[u.sort_by{|k,v| _core_order[k]}]} - .each{|u|u["extra"] = Hash[u["extra"].sort_by{|k,v| _extra_order[k]}] if u["extra"]} - .to_yaml |