Tattle Host OS
Eric Hodel | Wed, 10 Jan 2007 16:03:00 GMT
After two days and 562 tattle reports a picture of rubyists' operating system choice is emerging:
$ ruby filter_host_os.rb tattle-host_os-20070110-1053.yml
darwin8: 242
linux-gnu: 161
mswin32: 116
freebsd6: 16
solaris2: 7
darwin7: 5
cygwin: 4
openbsd4: 4
linux: 2
freebsd5: 2
darwin9: 2
openbsd3: 1
Generated from:
$ cat filter_host_os.rb
require 'yaml'
data = YAML.load ARGF.read
collapsed = Hash.new 0
data['host_os'].each do |os, count|
os =~ /^(.*?)(\.|$)/
collapsed[$1] += count
end
length = collapsed.keys.sort_by { |k| -k.length }.first.length
collapsed.sort_by { |o,c| -c }.each do |os,count|
puts "%#{length}s: %d" % [os, count]
end
2 comments
Comments are disabled


Articles