• R/O
  • SSH
  • HTTPS

dietmemorer: Commit


Commit MetaInfo

Revision19 (tree)
Time2008-01-22 16:17:06
Authoryaggy

Log Message

単純ミスの修正

Change Summary

Incremental Difference

--- trunk/src/mail_analizer.rb (revision 18)
+++ trunk/src/mail_analizer.rb (revision 19)
@@ -184,7 +184,7 @@
184184 end
185185
186186 # ヘルプ要求っぽかったら、ヘルプ送信
187- if in_ary(@@sub_help, mailsub) \
187+ if MailAnalizer.in_ary(@@sub_help, mailsub) \
188188 or mailbody == nil or mailbody == "" then
189189 sth.finish
190190 Debug.p "send help."
@@ -238,14 +238,14 @@
238238 elsif 2 == field.size then
239239 Debug.p field
240240
241- if in_ary(@@body_weight, field[0]) then
241+ if MailAnalizer.in_ary(@@body_weight, field[0]) then
242242
243243 # 体重入力っぽい場合
244244 tsth = @dbh.prepare("SELECT mailadd, adddate FROM dweight WHERE mailadd = ? AND adddate = ?")
245245 tsth.execute(mailfrom, nowtime)
246- if 0 != sth.rows then
247- isth = @dbh.prepare("UPDATE FROM dweight SET mailadd = ?, weight = ?, adddate = ?")
248- isth.execute(mailfrom, field[1], nowtime)
246+ if 0 != tsth.rows then
247+ isth = @dbh.prepare("UPDATE dweight SET weight = ? WHERE mailadd = ? AND adddate = ?")
248+ isth.execute(field[1], mailfrom, nowtime)
249249 isth.finish
250250 else
251251 isth = @dbh.prepare("INSERT INTO dweight (mailadd, weight, adddate) values(?, ?, ?)")
@@ -254,13 +254,13 @@
254254 end
255255 tsth.finish
256256
257- elsif in_ary(@@body_fat, field[0]) then
257+ elsif MailAnalizer.in_ary(@@body_fat, field[0]) then
258258 # 体脂肪入力っぽい場合
259259 tsth = @dbh.prepare("SELECT mailadd, adddate FROM dfat WHERE mailadd = ? AND adddate = ?")
260260 tsth.execute(mailfrom, nowtime)
261- if 0 != sth.rows then
262- isth = @dbh.prepare("UPDATE FROM dfat SET mailadd = ?, fat = ?, adddate = ?")
263- isth.execute(mailfrom, field[1], nowtime)
261+ if 0 != tsth.rows then
262+ isth = @dbh.prepare("UPDATE dfat SET fat = ? WHERE mailadd = ? AND adddate = ?")
263+ isth.execute(field[1], mailfrom, nowtime)
264264 isth.finish
265265 else
266266 isth = @dbh.prepare("INSERT INTO dfat (mailadd, fat, adddate) values(?, ?, ?)")
@@ -322,10 +322,10 @@
322322 # 体重
323323 tsth = @dbh.prepare("SELECT weight FROM dweight WHERE mailadd = ? AND adddate = ?")
324324 tsth.execute(mailfrom, rndate)
325- if 0 != sth.rows then
326- kg = weight[0]
325+ if 0 != tsth.rows then
327326 tsth.fetch do |weight|
328- detail.concat("体重 " + kg + "kg\n")
327+ kg = weight[0]
328+ detail.concat("体重 " + kg.to_s + "kg\n")
329329 end
330330 end
331331 tsth.finish
@@ -333,11 +333,11 @@
333333 # 体脂肪
334334 tsth = @dbh.prepare("SELECT fat FROM dfat WHERE mailadd = ? AND adddate = ?")
335335 tsth.execute(mailfrom, rndate)
336- if 0 != sth.rows then
336+ if 0 != tsth.rows then
337337 tsth.fetch do |fat|
338- detail.concat("体脂肪率 " + fat[0] + "% ")
338+ detail.concat("体脂肪率 " + fat[0].to_s + "% ")
339339 if 0 != kg then
340- detail.concat("(体脂肪 " + fat[0] * kg / 100 + "kg)")
340+ detail.concat("(体脂肪 " + (fat[0] * kg / 100).to_s + "kg)")
341341 end
342342 detail.concat("\n")
343343 end
Show on old repository browser