tamouse m. wrote in post #1130882:
>> What is it complaining about "require?" Yeh, I've got "require" there at
> Mac):
Thanks, Jesus. I checked my script and I do have the shebang there.
Thanks, anyway.
--
Posted via http://www.ruby-forum.com/\.
It might help if you pasted the script.
Uh, it's pretty big. But, here it is. Thanks.
#/Users/peterbailey/.rbenv/shims/ruby
require 'rubygems'
#noinspection RubyResolve
require 'httpclient'
orcafile = ARGV[0]
host = 'http://ps2000-graphics-prod.bna.com'
#noinspection RubyResolve
clnt = HTTPClient.new
clnt.set_auth(nil, 'production', 'prod')
#Find PNG on Orca
format = 'png'
url = URI.parse("#{host}/images/view/#{format}/#{orcafile}")
pngfile = orcafile + '.png'
response = clnt.head(url)
#noinspection RubyResolve
if HTTP::Status.successful?(response.status)
puts "#{pngfile} is on Orca.\n"
else
puts "#{pngfile} is NOT on Orca.\n"
end
#Find PDF on Orca
format = 'pdf'
url = URI.parse("#{host}/images/view/#{format}/#{orcafile}")
pdffile = orcafile + '.pdf'
response = clnt.head(url)
#noinspection RubyResolve
if HTTP::Status.successful?(response.status)
puts "#{pdffile} is on Orca.\n"
else
puts "#{pdffile} is NOT on Orca.\n"
end
#Find TIFF on Orca
format = 'tiff'
url = URI.parse("#{host}/images/view/#{format}/#{orcafile}")
tifffile = orcafile + '.tif'
response = clnt.head(url)
#noinspection RubyResolve
if HTTP::Status.successful?(response.status)
puts "#{tifffile} is on Orca.\n"
else
puts "#{tifffile} is NOT on Orca.\n"
end
#Find GIF on Orca
format = 'gif'
url = URI.parse("#{host}/images/view/#{format}/#{orcafile}")
giffile = orcafile + '.gif'
response = clnt.head(url)
#noinspection RubyResolve
if HTTP::Status.successful?(response.status)
puts "#{giffile} is on Orca.\n"
else
puts "#{giffile} is NOT on Orca.\n"
end
#Find EPS on Orca
format = 'eps'
url = URI.parse("#{host}/images/view/#{format}/#{orcafile}")
epsfile = orcafile + '.eps'
response = clnt.head(url)
#noinspection RubyResolve
if HTTP::Status.successful?(response.status)
puts "#{epsfile} is on Orca.\n"
else
puts "#{epsfile} is NOT on Orca.\n"
end
puts "\n"
#PS2000 Files
orcafile = File.basename(orcafile, '.*')
if orcafile.match(/^ehs-/)
exit
end
if File.exist?("/volumes/graphics/artrefpdf_color/master/#{orcafile}")
filetime =
File.stat("/volumes/graphics/artrefpdf_color/master/#{orcafile}").mtime
filedirectory = '/volumes/graphics/artrefpdf_color/master/'
filetime = filetime.to_s.gsub(/ -0[0-9]00/, '')
puts "#{orcafile} is in the Color PS2k image library at:
DIRECTORY #{filedirectory}\n DATED #{filetime}\n"
end
···
On Tue, Dec 17, 2013 at 11:22 AM, Peter Bailey <lists@ruby-forum.com> > wrote:
#
#
if File.exist?("/volumes/graphics/images_9/master/#{orcafile}")
filetime =
File.stat("/volumes/graphics/images_9/master/#{orcafile}").mtime
filedirectory = '/volumes/graphics/images_9/master/'
filetime = filetime.to_s.gsub(/ -0[0-9]00/, '')
#noinspection RubyResolve,RubyResolve,RubyResolve
puts "#{orcafile} is in the regular PS2K image library at:
DIRECTORY #{filedirectory}\n DATED #{filetime}."
elsif File.exist?("/volumes/graphics/images_8/master/#{orcafile}")
filetime =
File.stat("/volumes/graphics/images_8/master/#{orcafile}").mtime
filedirectory = '/volumes/graphics/images_8/master/'
filetime = filetime.to_s.gsub(/ -0[0-9]00/, '')
puts "#{orcafile} is in the regular PS2K image library at:
DIRECTORY #{filedirectory}\n DATED #{filetime}\n"
elsif File.exist?("/volumes/graphics/images_7/master/#{orcafile}")
filetime =
File.stat("/volumes/graphics/images_7/master/#{orcafile}").mtime
filedirectory = '/volumes/graphics/images_7/master/'
filetime = filetime.to_s.gsub(/ -0[0-9]00/, '')
puts "#{orcafile} is in the regular PS2K image library at:
DIRECTORY #{filedirectory}\n DATED #{filetime}\n"
elsif File.exist?("/volumes/graphics/images_6/master/#{orcafile}")
filetime =
File.stat("/volumes/graphics/images_6/master/#{orcafile}").mtime
filedirectory = '/volumes/graphics/images_6/master/'
filetime = filetime.to_s.gsub(/ -0[0-9]00/, '')
puts "#{orcafile} is in the regular PS2K image library at:
DIRECTORY #{filedirectory}\n DATED #{filetime}\n"
elsif File.exist?("/volumes/graphics/images_5/master/#{orcafile}")
filetime =
File.stat("/volumes/graphics/images_5/master/#{orcafile}").mtime
filedirectory = '/volumes/graphics/images_5/master/'
filetime = filetime.to_s.gsub(/ -0[0-9]00/, '')
puts "#{orcafile} is in the regular PS2K image library at:
DIRECTORY #{filedirectory}\n DATED #{filetime}\n"
elsif File.exist?("/volumes/graphics/images_4/master/#{orcafile}")
filetime =
File.stat("/volumes/graphics/images_4/master/#{orcafile}").mtime
filedirectory = '/volumes/graphics/images_4/master/'
filetime = filetime.to_s.gsub(/ -0[0-9]00/, '')
puts "#{orcafile} is in the regular PS2K image library at:
DIRECTORY #{filedirectory}\n DATED #{filetime}\n"
elsif File.exist?("/volumes/graphics/images_3/master/#{orcafile}")
filetime =
File.stat("/volumes/graphics/images_3/master/#{orcafile}").mtime
filedirectory = '/volumes/graphics/images_3/master/'
filetime = filetime.to_s.gsub(/ -0[0-9]00/, '')
puts "#{orcafile} is in the regular PS2K image library at:
DIRECTORY #{filedirectory}\n DATED #{filetime}\n"
elsif File.exist?("/volumes/graphics/images_2/master/#{orcafile}")
filetime =
File.stat("/volumes/graphics/images_2/master/#{orcafile}").mtime
filedirectory = '/volumes/graphics/images_2/master/'
filetime = filetime.to_s.gsub(/ -0[0-9]00/, '')
puts "#{orcafile} is in the regular PS2K image library at:
DIRECTORY #{filedirectory}\n DATED #{filetime}\n"
elsif File.exist?("/volumes/graphics/images_1/master/#{orcafile}")
filetime =
File.stat("/volumes/graphics/images_1/master/#{orcafile}").mtime
filedirectory = '/volumes/graphics/images_1/master/'
filetime = filetime.to_s.gsub(/ -0[0-9]00/, '')
puts "#{orcafile} is in the regular PS2K image library at:
DIRECTORY #{filedirectory}\n DATED #{filetime}\n"
else
puts "The file is not in the ps2000 image library. It's probably for a
web-only service."
end
--
Posted via http://www.ruby-forum.com/\.