#!/usr/bin/ruby

require 'infobar'

paths = %w[ . ] + `bundle list --paths`.lines.map(&:chomp)
cmd = %w[ ctags --recurse=yes --languages=Ruby,C ] + paths
Infobar.busy(label: 'Creating tags') { system *cmd }
if megabytes = File.size('tags').to_f / 1024 ** 2 rescue nil
  infobar.puts 'Created %.3fM of tags.' % megabytes
end