class Build < Array def self.discover_commands commands # Gem builds, `gem build dev_tasks.spec` Dir.glob('*.spec') {|f| commands["build"] = Build.new if(!commands.has_key?("build")) commands["build"].add "gem build #{f}" } end def add command self << command if(!include?(command)) end end