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}" } # .sln builds, `"C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe" "MySolution.sln" Dir.glob('*.sln'){|f| if File.exist? msbuild commands["build"] = Build.new if(!commands.has_key?("build")) commands["build"].add "\"#{self.msbuild}\" \"#{f}\" /nologo /p:Configuration=Release" end } end def self.msbuild "C:\\Program Files (x86)\\MSBuild\\12.0\\bin\\msbuild.exe" end def add command self << command if(!include?(command)) end end