■ amazon.rb(9)
一応、下記のようにさまざまな処理を削ってファイル書き込みできるのかをチェック
・ ←<%=test_isbn 'abcd'%>かな
#test02.rb 200208312110
def test_isbn( asin )
begin
cache = '/hoge/cache/amazon'
aid = '4150113513'
item_url = 'url'
item_name = 'name'
img_url = 'i_url'
img_name = 'i_name'
img_width = 'width'
img_height = 'height'
Dir::mkdir( cache ) unless File::directory?( cache )
item = [item_url.strip,item_name,img_url,img_name,img_width,img_height]
open("#{cache}/#{aid}","w") do |f|
item.each do |i|
next unless i
f.print i,"\n"
end
end
end
end