Sha256: 9a5db756b95a3a04501f1f38923ef9b04c5204c6db2085a67462d76e7722de6f

Contents?: true

Size: 669 Bytes

Versions: 15

Compression:

Stored size: 669 Bytes

Contents

#!/usr/bin/env ruby

if ARGV.size==0
  puts "USAGE: mandy-local my_script.rb local_input_file local_output_folder"
  exit
end

require "fileutils"

def absolute_path(path)
  path =~ /^\// ? path : File.join(Dir.pwd, path)
end

file   = absolute_path(ARGV[0])
input  = absolute_path(ARGV[1])
output_folder = FileUtils.mkdir_p(absolute_path(ARGV[2]))
require file

Mandy::Job.jobs.each_with_index do |job, i|
  out = File.join(output_folder, "#{i+1}-#{job.name.downcase.gsub(/\W/, '-')}")
  puts "Running #{job.name}..."
  `cat #{input} | mandy-map #{file} "#{job.name}" | sort | mandy-reduce #{file} "#{job.name}" > #{out}`
  input = out
end

puts "All Done! [#{input}]"

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
trafficbroker-mandy-0.1.5 bin/mandy-local
trafficbroker-mandy-0.1.6 bin/mandy-local
trafficbroker-mandy-0.1.7 bin/mandy-local
trafficbroker-mandy-0.1.8 bin/mandy-local
trafficbroker-mandy-0.1.9 bin/mandy-local
trafficbroker-mandy-0.2.2 bin/mandy-local
trafficbroker-mandy-0.2.3 bin/mandy-local
trafficbroker-mandy-0.2.4.2 bin/mandy-local
trafficbroker-mandy-0.2.4.3 bin/mandy-local
trafficbroker-mandy-0.2.4.4 bin/mandy-local
trafficbroker-mandy-0.2.4.5 bin/mandy-local
trafficbroker-mandy-0.2.4.6 bin/mandy-local
trafficbroker-mandy-0.2.4 bin/mandy-local
trafficbroker-mandy-0.2.5 bin/mandy-local
trafficbroker-mandy-0.2 bin/mandy-local