From a8c748d2773b6ce5d871360ee36f7d214ae1af11 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 16 Apr 2007 13:53:09 +0000 Subject: [PATCH] * sample: replace TRUE, FALSE with true, false respectively. a patch from Kazuhiro NISHIYAMA . [ruby-dev:30713] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ sample/cbreak.rb | 4 ++-- sample/dualstack-httpd.rb | 2 +- sample/eval.rb | 2 +- sample/from.rb | 2 +- sample/philos.rb | 2 +- sample/regx.rb | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9f70aa3f28..9ab73ae5f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Apr 16 22:51:11 2007 Yukihiro Matsumoto + + * sample: replace TRUE, FALSE with true, false respectively. + a patch from Kazuhiro NISHIYAMA . + [ruby-dev:30713] + Mon Apr 16 17:08:02 2007 Nobuyoshi Nakada * lib/optparse.rb (make_switch): do not clobber converter if pattern diff --git a/sample/cbreak.rb b/sample/cbreak.rb index cbb15d2f41..76b534a76a 100644 --- a/sample/cbreak.rb +++ b/sample/cbreak.rb @@ -6,11 +6,11 @@ TIOCGETP = 0x40067408 TIOCSETP = 0x80067409 def cbreak () - set_cbreak(TRUE) + set_cbreak(true) end def cooked () - set_cbreak(FALSE) + set_cbreak(false) end def set_cbreak (on) diff --git a/sample/dualstack-httpd.rb b/sample/dualstack-httpd.rb index 893b29feba..69e3181863 100644 --- a/sample/dualstack-httpd.rb +++ b/sample/dualstack-httpd.rb @@ -26,7 +26,7 @@ end ls = mysock # copy to dynamic variable t = Thread.current STDERR.print "socket #{myname} listener started, pid #{$$} thread #{t}\n" - while TRUE + while true as = ls.accept Thread.start do STDERR.print "socket #{myname} accepted, thread ", Thread.current, "\n" diff --git a/sample/eval.rb b/sample/eval.rb index 90b839e873..ed4b7c3de5 100644 --- a/sample/eval.rb +++ b/sample/eval.rb @@ -1,6 +1,6 @@ line = '' indent = 0 -$stdout.sync = TRUE +$stdout.sync = true print "ruby> " loop do l = gets diff --git a/sample/from.rb b/sample/from.rb index 59cc387792..6b0c702bb7 100644 --- a/sample/from.rb +++ b/sample/from.rb @@ -26,7 +26,7 @@ class String end if ARGV[0] == '-w' - wait = TRUE + wait = true ARGV.shift end diff --git a/sample/philos.rb b/sample/philos.rb index 119e7c36b9..5c8f43c819 100644 --- a/sample/philos.rb +++ b/sample/philos.rb @@ -25,7 +25,7 @@ def eat(n) end def philosopher(n) - while TRUE + while true think n $forks[n].lock if not $forks[(n+1)%N].try_lock diff --git a/sample/regx.rb b/sample/regx.rb index aaf4b5f1ee..6d90b7f293 100644 --- a/sample/regx.rb +++ b/sample/regx.rb @@ -3,7 +3,7 @@ en = "\033[m" #st = "<<" #en = ">>" -while TRUE +while true print "str> " STDOUT.flush input = gets