[#21736] OBJECTDAY 2000 — 助田 雅紀 <masaki.suketa@...>

助田です.

29 messages 2000/04/03
[#21748] Re: OBJECTDAY 2000 — keiju@... (石塚圭樹) 2000/04/04

けいじゅ@日本ラショナルソフトウェアです.

[#21753] Re: OBJECTDAY 2000 — Hideto ISHIBASHI <hideto-i@...4u.or.jp> 2000/04/05

石橋秀仁です。

[#21755] Re: OBJECTDAY 2000 — keiju@... (石塚圭樹) 2000/04/05

けいじゅ@日本ラショナルソフトウェアです.

[#21837] site_ruby & Linux distribution — OZAWA Sakuro <crouton@...>

小澤さくです。

14 messages 2000/04/10

[#21922] ruby-1.4.4 binary for BeOS 5 (Intel) — tenmei@... (Noriaki Harada)

はらだです。

23 messages 2000/04/15
[#21923] Re: ruby-1.4.4 binary for BeOS 5 (Intel) — NAITOH Jun <naitoh@...> 2000/04/15

はじめまして、内藤と申します。

[#21926] Re: ruby-1.4.4 binary for BeOS 5 (Intel) — tenmei@... (Noriaki Harada) 2000/04/16

>はじめまして、内藤と申します。

[#21930] Re: ruby-1.4.4 binary for BeOS 5 (Intel) — NAITOH Jun <naitoh@...> 2000/04/16

内藤です。

[#21968] Re: ruby-1.4.4 binary for BeOS 5 (Intel) — Katsuyuki Komatsu <komatsu@...> 2000/04/17

小松です。

[#21969] Re: ruby-1.4.4 binary for BeOS 5 (Intel) — NAITOH Jun <naitoh@...> 2000/04/17

再び内藤です。

[#21956] Thread & STDIN — Masato Toyoshima <mt@...>

はじめまして、豊島といいます。

16 messages 2000/04/17

[#21981] rd2man — WATANABE Hirofumi <eban@...>

わたなべです.

29 messages 2000/04/18
[#21982] Re: rd2man — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 2000/04/18

Toshです。

[#21985] Re: rd2man — WATANABE Hirofumi <Hirofumi.Watanabe@...> 2000/04/19

わたなべです.

[#22036] Re: rd2man — Wakou Aoyama <wakou@...> 2000/04/20

青山です。

[#22040] Re: rd2man — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 2000/04/21

Toshです。

[#22014] shell interactive — WATANABE Daisaku <dwata@...3.rim.or.jp>

31 messages 2000/04/20
[#22016] Re: shell interactive — 時田幸粋 <ktokita@...> 2000/04/20

こんにちは、時田です。

[#22017] Re: shell interactive — nobu.nakada@... 2000/04/20

なかだです。

[#22018] Re: shell interactive — WATANABE Hirofumi <Hirofumi.Watanabe@...> 2000/04/20

わたなべです.

[#22027] Re: shell interactive — 時田幸粋 <ktokita@...> 2000/04/20

こんにちは、時田です。

[#22103] Please put ruby-1.4.4.tar.gz in pub/lang/ruby/1.4/ — "Akinori -Aki- MUSHA" <knu@...>

 お願いがあるのですが、 ruby-1.4.4.tar.gz を FTP ツリーの 1.4/

16 messages 2000/04/25
[#22199] Where to put ruby-i.j.k.tar.gz on? (Re: ) — SUGIHARA Hiroshi <maili31s@...> 2000/04/28

[ruby-list:22103]におきまして、2000/04/25 12:38ほどに、

[#22117] StateGraph: state machine interpreter — Hideto ISHIBASHI <hideto-i@...4u.or.jp>

石橋 "rubyholic" 秀仁です。

16 messages 2000/04/25

[#22159] $LOAD_PATH への追加について — "Sugawara Hajime" <sugawara@...>

 はじめまして、菅原@ホビー・データです。

13 messages 2000/04/27

[#22181] Can't Use optparse — Yamada Kenji <kyamada@...>

28 messages 2000/04/28
[#22186] Re: Can't Use optparse — akira yamada / やまだあきら <akira@...> 2000/04/28

[#22195] Re: Can't Use optparse — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 2000/04/28

Toshです。

[#22261] Re: Can't Use optparse — nobu.nakada@... 2000/05/04

なかだです。

[#22264] Re: Can't Use optparse — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 2000/05/04

Toshです。

[#22270] Re: Can't Use optparse — nobu.nakada@... 2000/05/04

なかだです。

[#22272] Re: Can't Use optparse — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp> 2000/05/04

Toshです。

[#22300] Re: Can't Use optparse — Koji Arai <JCA02266@...> 2000/05/05

新井です。

[ruby-list:21887] psql.rb の修正

From: Saitou Noboru <noborus@...>
Date: 2000-04-13 15:44:49 UTC
List: ruby-list #21887
 斉藤 登と申します。
 PostgreSQL用拡張ライブラリの psql.rb をみて学んでたんですが、挙動が
おかしい所があったので修正しました。
 修正点は、
 ・sql文にエラーがあった場合、その後の sql を実行してくれなくなるの
    を修正。
 ・ファイルからの入力がうまくいかなかったのを修正。起動オプションで
   は -f 。コマンドでは \i。
 ・\E がうまく動かなかったのを修正。
 ・細かい点を少し修正。

 以上です。
----
 斉藤 登        Saitou Noboru <noborus@mb.kcom.ne.jp>
      http://webclub.kcom.ne.jp/mb/noborus/
     ----

Attachments (1)

psql.diff (3.55 KB, text/x-diff)
--- psql.rb.orig	Tue Jul 13 13:13:33 1999
+++ psql.rb	Thu Apr 13 21:57:47 2000
@@ -599,29 +599,27 @@
 
   when 'E'
     if args[1]
-      lastfile = args[1]
+      begin
+	lastfile = args[1]
+	File.file?(lastfile) && (mt = File.mtime(lastfile))
+	editFile(lastfile)
+	File.file?(lastfile) && (mt2 = File.mtime(lastfile))
+	fd = File.new(lastfile, "r")
+	if mt != mt2
+	  MainLoop(settings, fd)
+	  fd.close()
+	else
+	  if !settings.quiet
+	    printf(STDERR, "warning: %s not modified. query not executed\n", lastfile)
+	  end
+	  fd.close()
+	end
+      rescue
+	#
+      end
     else
       printf(STDERR, "\\r must be followed by a file name initially\n");
-      break
-    end
-
-    st = File.stat(lastfile)
-    editFile(lastfile)
-    if ((st2 = File.stat(lastfile) == nil) || 
-	(fd = File.new(lastfile, "r") == nil))
-      break
-    end
-
-    if st2.mtime == st.mtime
-      if !settings.quiet
-	printf(STDERR, "warning: %s not modified. query not executed\n", lastfile)
-      end
-      fd.close()
-      break
     end
-    MainLoop(settings, fd)
-    fd.close()
-    
   when 'f'
     if args[1]
       settings.opt.fieldSep = args[1]
@@ -645,17 +643,17 @@
     do_help(args[1])
 
   when 'i' # \i is include file
-    if !args[1]
+    if args[1]
+      begin
+	fd = File.open(args[1], "r")
+	MainLoop(settings, fd)
+	fd.close()
+      rescue Errno::ENOENT
+	printf(STDERR, "file named %s could not be opened\n", args[1])
+      end
+    else
       printf(STDERR, "\\i must be followed by a file name\n")
-      break
-    end
-    if fd = File.new(args[1], "r") == nil
-      printf(STDERR, "file named %s could not be opened\n", args[1])
-      break
     end
-    MainLoop(settings, fd)
-    fd.close()
-
   when 'l' # \l is list database
     listAllDbs(settings)
 
@@ -750,7 +748,7 @@
 
   if settings.singleStep
     printf("\n**************************************");
-    ptintf("*****************************************\n")
+    printf("*****************************************\n")
     STDOUT.flush
     printf("\npress return to continue ..\n");
     gets("", STDIN);
@@ -771,8 +769,8 @@
 	  settings.queryFout = STDOUT
 	end
       else
-      results.print(settings.queryFout, settings.opt)
-      settings.queryFout.flush
+	results.print(settings.queryFout, settings.opt)
+	settings.queryFout.flush
       end
       results.clear
 
@@ -885,13 +883,12 @@
       if line.length == 0
 	next
       end
-      p line
       ### begin slash command handling ###
       if line[0, 1] == "\\"
 	query = line
 	slashCmdStatus, query = HandleSlashCmds(settings, line, nil)
 	if slashCmdStatus == 0 && query != nil
-	  success = success && SendQuery(settings, query, FALSE, FALSE, 0)
+	  success = SendQuery(settings, query, FALSE, FALSE, 0) && success
 	  querySent = TRUE
 	elsif slashCmdStatus == 1
 	  query = nil
@@ -905,7 +902,7 @@
       ### begin query command handling ###
       slashCmdStatus = -1
       if settings.singleLineMode
-	success = success && SendQuery(settings, line, FALSE, FALSE, 0)
+	success = SendQuery(settings, line, FALSE, FALSE, 0) && success
 	querySent = TRUE
       else
 
@@ -926,7 +923,7 @@
 	    query = queryWaiting
 	    queryWaiting = nil
 
-	    success = success && SendQuery(settings, query, FALSE, FALSE, 0)
+	    success = SendQuery(settings, query, FALSE, FALSE, 0) && success
 	    querySent = TRUE
 	  else
 	    querySent = FALSE
@@ -1080,7 +1077,7 @@
     if singleSlashCmd
       line = singleQuery
     else
-      sprintf(line, "\\i %s", qfilename)
+      line = sprintf("\\i %s", qfilename)
     end
     HandleSlashCmds(settings, line, "")
   else

In This Thread

Prev Next