I’m getting failures when I try to run these two Ruby scripts inside
this one here. But, in the command shell, when I go to that directory, I
can run those other two Ruby scripts just fine. All I’m doing here is
parsing out particular filetypes, by virtue of the filenames and
extensions, and then trying to run separate Ruby scripts on those files.
data1 = config[“filenames”]
data2 = config[“destinations”]
data1.keys.each do |filetype|
filenames = data1[filetype]
target = data2[filetype]
filenames.split(", ").each do |pattern|
if pattern == “aicpa*.gif”
puts “executing the AICPA GIF script.” E:/Apps/scripts/ruby/FileTrain/SMMS2/AICPA/AICPA_gif.rb
puts “That Ruby script, AICPA_gif.rb, did not run.”
if pattern == “aicpa*.jpg”
puts “executing the AICPA JPEG script.” E:/Apps/scripts/ruby/FileTrain/SMMS2/AICPA/AICPA_jpeg.rb
puts “That Ruby script, AICPA_jpeg.rb, did not run.”
This is my output:
executing the AICPA GIF script.
That Ruby script, AICPA_gif.rb, did not run.
executing the AICPA JPEG script.
That Ruby script, AICPA_jpeg.rb, did not run.
Yes, I use backticks. I use them a lot because I have to do a lot of
command shell stuff.
I tried using system("…") here, but, that didn’t work. I got it to
work here, at least where it could tell me that the scripts did not run.
I’m sorry, but, I don’t know what you mean by “load” or “require.” Do I
have to “require” an outside script that I want to run inside this
script? I’ll look up what “load” mean.