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