Problem with FileUtils move command

Try something really dead simple like this to see what’s going on:

C:> ruby.exe -e ‘ARGV.each {|arg| p arg}’ one two three four

then try:

C:> ruby.exe -e ‘ARGV.each {|arg| p arg}’ .

tamouse mailing lists wrote in post #1108354:

Try something really dead simple like this to see what’s going on:

C:> ruby.exe -e ‘ARGV.each {|arg| p arg}’ one two three four

then try:

C:> ruby.exe -e ‘ARGV.each {|arg| p arg}’ .

I get this:

F:\workflows\graphics\Asura-Non\RCSCR\in>ruby.exe -e ‘ARGV.each {|arg| p
arg}’ one two three four
‘arg’ is not recognized as an internal or external command,
operable program or batch file.

F:\workflows\graphics\Asura-Non\RCSCR\in>ruby.exe -e ‘ARGV.each {|arg| p
arg}’ .
‘arg’ is not recognized as an internal or external command,
operable program or batch file.

Peter B. wrote in post #1108388:

Matthew K. wrote in post #1108321:

On May 9, 2013 2:51 AM, “Daniel S.” [email protected]
wrote:

Maybe it’s not in [0]?? Drop that loop at the top of your script as well
and lets see what we get.

ARGV.each do |arg|
puts “Argument: #{arg}”
end

Pro tip: When debugging vars that may be nil, use #p instead of #puts.
You
get much more useful output, e.g.:

p ARGV[0] #=> nil
p ARGV #=> []

Sent from my phone, so excuse the typos.

I get this:

F:\workflows\graphics\Asura-Non\RCSCR\in>e:\live\scripts\ruby\asura-non\rcscr\rcscr_pdf_single.rb

hlst205ar-15.pdf
nil
[]
ARGV ==
C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:1631:in path': no implicit conversion of nil into String (TypeError) from C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:1631:in fu_each_src_dest0’
from C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:1618:in
fu_each_src_dest' from C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:580:in mv’
from
e:/live/scripts/ruby/asura-non/rcscr/RCSCR_PDF_single.rb:33:in `’

OK, gentlemen. I figured it out. I’m just an idiot. If you look at the
top of this Ruby script, you’ll see that I do a parse of the PDF file to
see if it’s a “healthy” PDF file. We use a program called Image Alchemy
to do that. And, . . ., these are bad PDF files!!! And, because of that,
as they’re told, they’re moved to a sister “badfiles” directory. So,
they’re not there to MOVE!

I’m sorry for all your time. You guys have been great.

Cheers,
Peter

Matthew K. wrote in post #1108321:

On May 9, 2013 2:51 AM, “Daniel S.” [email protected]
wrote:

Maybe it’s not in [0]?? Drop that loop at the top of your script as well
and lets see what we get.

ARGV.each do |arg|
puts “Argument: #{arg}”
end

Pro tip: When debugging vars that may be nil, use #p instead of #puts.
You
get much more useful output, e.g.:

p ARGV[0] #=> nil
p ARGV #=> []

Sent from my phone, so excuse the typos.

I get this:

F:\workflows\graphics\Asura-Non\RCSCR\in>e:\live\scripts\ruby\asura-non\rcscr\rcscr_pdf_single.rb
hlst205ar-15.pdf
nil
[]
ARGV ==
C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:1631:in path': no implicit conversion of nil into String (TypeError) from C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:1631:in fu_each_src_dest0’
from C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:1618:in
fu_each_src_dest' from C:/Ruby200/lib/ruby/2.0.0/fileutils.rb:580:in mv’
from
e:/live/scripts/ruby/asura-non/rcscr/RCSCR_PDF_single.rb:33:in `’

On Thu, May 9, 2013 at 6:52 AM, Peter B. [email protected]
wrote:

OK, gentlemen.

This mouse refuses to be gentlemanly.