#!/bin/bash if [[ $# -ne 3 ]] ; then echo Usage: $0 [zipfile] [author_name] [album_name] exit 1 fi merb -i < album.id, :file => { :content_type => 'image/jpeg', :size => ifile.size, :tempfile => ifile, :filename => ifile_name } photo.author_id = author.id unless photo.save \$stderr.puts "PHOTO (#{ifile_name}) SAVE FAILED:" photo.errors.each_full { |msg| \$stderr.puts " * #{msg}" } end end end EOF