Sha256: 648bddb4a33713d845532ed0f279e29facc53dd7457bb3943f39833970538835

Contents?: true

Size: 660 Bytes

Versions: 18

Compression:

Stored size: 660 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

out = nil
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 out

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
trafficbroker-mandy-0.2.10 bin/mandy-local
trafficbroker-mandy-0.2.11 bin/mandy-local
trafficbroker-mandy-0.2.12 bin/mandy-local
trafficbroker-mandy-0.2.13 bin/mandy-local
trafficbroker-mandy-0.2.5.1 bin/mandy-local
trafficbroker-mandy-0.2.6 bin/mandy-local
trafficbroker-mandy-0.2.7 bin/mandy-local
trafficbroker-mandy-0.2.8 bin/mandy-local
mandy-0.3.9 bin/mandy-local
mandy-0.3.7 bin/mandy-local
mandy-0.3.6 bin/mandy-local
mandy-0.3.5 bin/mandy-local
mandy-0.3.4 bin/mandy-local
mandy-0.3.3 bin/mandy-local
mandy-0.3.2 bin/mandy-local
mandy-0.3.1 bin/mandy-local
mandy-0.2.15 bin/mandy-local
mandy-0.2.14 bin/mandy-local