mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* sample: replace TRUE, FALSE with true, false respectively.
a patch from Kazuhiro NISHIYAMA <zn at mbf.nifty.com>. [ruby-dev:30713] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
380ea10dfa
commit
a8c748d277
7 changed files with 13 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Mon Apr 16 22:51:11 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* sample: replace TRUE, FALSE with true, false respectively.
|
||||||
|
a patch from Kazuhiro NISHIYAMA <zn at mbf.nifty.com>.
|
||||||
|
[ruby-dev:30713]
|
||||||
|
|
||||||
Mon Apr 16 17:08:02 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Apr 16 17:08:02 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/optparse.rb (make_switch): do not clobber converter if pattern
|
* lib/optparse.rb (make_switch): do not clobber converter if pattern
|
||||||
|
|
|
@ -6,11 +6,11 @@ TIOCGETP = 0x40067408
|
||||||
TIOCSETP = 0x80067409
|
TIOCSETP = 0x80067409
|
||||||
|
|
||||||
def cbreak ()
|
def cbreak ()
|
||||||
set_cbreak(TRUE)
|
set_cbreak(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def cooked ()
|
def cooked ()
|
||||||
set_cbreak(FALSE)
|
set_cbreak(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_cbreak (on)
|
def set_cbreak (on)
|
||||||
|
|
|
@ -26,7 +26,7 @@ end
|
||||||
ls = mysock # copy to dynamic variable
|
ls = mysock # copy to dynamic variable
|
||||||
t = Thread.current
|
t = Thread.current
|
||||||
STDERR.print "socket #{myname} listener started, pid #{$$} thread #{t}\n"
|
STDERR.print "socket #{myname} listener started, pid #{$$} thread #{t}\n"
|
||||||
while TRUE
|
while true
|
||||||
as = ls.accept
|
as = ls.accept
|
||||||
Thread.start do
|
Thread.start do
|
||||||
STDERR.print "socket #{myname} accepted, thread ", Thread.current, "\n"
|
STDERR.print "socket #{myname} accepted, thread ", Thread.current, "\n"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
line = ''
|
line = ''
|
||||||
indent = 0
|
indent = 0
|
||||||
$stdout.sync = TRUE
|
$stdout.sync = true
|
||||||
print "ruby> "
|
print "ruby> "
|
||||||
loop do
|
loop do
|
||||||
l = gets
|
l = gets
|
||||||
|
|
|
@ -26,7 +26,7 @@ class String
|
||||||
end
|
end
|
||||||
|
|
||||||
if ARGV[0] == '-w'
|
if ARGV[0] == '-w'
|
||||||
wait = TRUE
|
wait = true
|
||||||
ARGV.shift
|
ARGV.shift
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ def eat(n)
|
||||||
end
|
end
|
||||||
|
|
||||||
def philosopher(n)
|
def philosopher(n)
|
||||||
while TRUE
|
while true
|
||||||
think n
|
think n
|
||||||
$forks[n].lock
|
$forks[n].lock
|
||||||
if not $forks[(n+1)%N].try_lock
|
if not $forks[(n+1)%N].try_lock
|
||||||
|
|
|
@ -3,7 +3,7 @@ en = "\033[m"
|
||||||
#st = "<<"
|
#st = "<<"
|
||||||
#en = ">>"
|
#en = ">>"
|
||||||
|
|
||||||
while TRUE
|
while true
|
||||||
print "str> "
|
print "str> "
|
||||||
STDOUT.flush
|
STDOUT.flush
|
||||||
input = gets
|
input = gets
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue