Sha256: 5111c622aa2d8b508a8867317eb2b5ff931d851538e2023f163b70f6b314b5f8
Contents?: true
Size: 1.62 KB
Versions: 1
Compression:
Stored size: 1.62 KB
Contents
require "buildem" require 'buildem/base' require 'buildem/configuration' require 'buildem/executor' require 'process_pool' require 'buildem/logger' module Kernel def unordered puts "Started unordered sequence" yield $pool = ProcessPool.new($configuration.workers) puts $configuration.workers $jobs.each do |command| $pool.schedule(command,command.argz) end $pool.start $pool.shutdown puts "Finished #{$jobs.size} unordered jobs" end def queued_run(command, optz = {}) $jobs << BuildEm::Executor.new([command,optz]) end def run(command, optz = {}) BuildEm::Executor.new([command,optz]).run end end class BuildEm::Runner $jobs = [] def initialize(kernel = Kernel, argv = ARGV) @kernel = kernel @argv = argv end def process_standard_in if @argv.empty? output = [] while input = @kernel.gets and not input == "start\n" output << input end unless output.empty? output = output.join("\n") @kernel.eval(output) end end end def start if ARGV.size == 1 begin puts "running #{ARGV[0]}" $configuration = BuildEm::Configuration.new load ARGV[0] ensure puts "finished #{ARGV[0]}" end else puts usage end end private def usage <<-USAGE ----------------------------------------------------------------- BUILD'EM ----------------------------------------------------------------- usage: buildem filename.buildem ----------------------------------------------------------------- USAGE end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
buildem-1.0.0 | lib/buildem/runner.rb |