8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/duracloud/commands/find_items.rb', line 8
def call
CSV.instance($stdout, headers: HEADERS, write_headers: true) do |csv|
CSV.foreach(infile, headers: false) do |row|
begin
item = Duracloud::Content.find(space_id: space_id, store_id: store_id, content_id: row[0], md5: row[1])
csv << HEADERS.map { || item.send() }
rescue Duracloud::NotFoundError, Duracloud::MessageDigestError => e
$stderr.puts "ERROR: Content ID #{row[0]} -- #{e.message}"
end
end
end
end
|