Answer the question
In order to leave comments, you need to log in
How to send each array element to pipeline?
Good day, Ruby.
There is a file which is read through readlines. Further there are some manipulations with these lines.
And then the string must be sent to the minio store via the pipeline.
The problem is that the pipeline to the store rises by launching the binary.
require 'shell'
shell.system("minio-cmd pipe minio-server/my_store/long_test.txt")
require 'shell'
shell = Shell.new
pipeline = shell.system("minio-cmd pipe minio-server/my_store/long_test.txt")
File.readlines('data.txt').each do |line|
shell.echo(line) | pipeline
end
def pipe_it
File.readlines('data.txt').each do |line|
.......
.......
yield(line)
end
end
pipe_it{|x| shell.echo("#{x}")} | pipeline
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question