summaryrefslogtreecommitdiff
path: root/sample/drb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-15 11:55:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-15 11:55:52 +0000
commit3a47cf3395dd4c4fe8bdd5df13aab698f2ca314b (patch)
treec4a278220ba8141b829c5c7b0777c1049cfe413c /sample/drb
parent39da1b63699faf30c86e753e193c29b81b16136d (diff)
* remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/drb')
-rw-r--r--sample/drb/darray.rb2
-rw-r--r--sample/drb/darrayc.rb4
-rw-r--r--sample/drb/dbiff.rb4
-rw-r--r--sample/drb/dchatc.rb4
-rw-r--r--sample/drb/dchats.rb2
-rw-r--r--sample/drb/dhasen.rb4
-rw-r--r--sample/drb/dhasenc.rb2
-rw-r--r--sample/drb/dlogc.rb2
-rw-r--r--sample/drb/dlogd.rb2
-rw-r--r--sample/drb/dqin.rb2
-rw-r--r--sample/drb/dqout.rb2
-rw-r--r--sample/drb/dqueue.rb2
-rw-r--r--sample/drb/drbc.rb2
-rw-r--r--sample/drb/drbch.rb2
-rw-r--r--sample/drb/drbm.rb6
-rw-r--r--sample/drb/drbmc.rb2
-rw-r--r--sample/drb/drbs-acl.rb6
-rw-r--r--sample/drb/drbs.rb4
-rw-r--r--sample/drb/extserv_test.rb12
-rw-r--r--sample/drb/holderc.rb2
-rw-r--r--sample/drb/holders.rb6
-rw-r--r--sample/drb/http0.rb6
-rw-r--r--sample/drb/http0serv.rb12
-rw-r--r--sample/drb/name.rb16
-rw-r--r--sample/drb/namec.rb2
-rw-r--r--sample/drb/old_tuplespace.rb6
-rw-r--r--sample/drb/ring_echo.rb2
-rw-r--r--sample/drb/simpletuple.rb6
-rw-r--r--sample/drb/speedc.rb2
-rw-r--r--sample/drb/speeds.rb4
30 files changed, 65 insertions, 65 deletions
diff --git a/sample/drb/darray.rb b/sample/drb/darray.rb
index 95ee01f..d2ac395 100644
--- a/sample/drb/darray.rb
+++ b/sample/drb/darray.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- Array
- Copyright (c) 1999-2001 Masatoshi SEKI
+ Copyright (c) 1999-2001 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/darrayc.rb b/sample/drb/darrayc.rb
index b181d22..579e115 100644
--- a/sample/drb/darrayc.rb
+++ b/sample/drb/darrayc.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- Array client
- Copyright (c) 1999-2001 Masatoshi SEKI
+ Copyright (c) 1999-2001 Masatoshi SEKI
=end
require 'drb/drb'
@@ -19,7 +19,7 @@ p a
puts "# find"
p ro.find { |x| x.kind_of? String }
-
+
puts "# each, break"
ro.each do |x|
next if x == "five"
diff --git a/sample/drb/dbiff.rb b/sample/drb/dbiff.rb
index 8faef50..b50edc0 100644
--- a/sample/drb/dbiff.rb
+++ b/sample/drb/dbiff.rb
@@ -18,13 +18,13 @@ class Biff
def run
last = Time.now
while true
- begin
+ begin
sleep(@interval)
current = File::mtime(@filename)
if current > last
changed
begin
- notify_observers(@filename, current)
+ notify_observers(@filename, current)
rescue Error
end
last = current
diff --git a/sample/drb/dchatc.rb b/sample/drb/dchatc.rb
index b506f5b..2b8ddbf 100644
--- a/sample/drb/dchatc.rb
+++ b/sample/drb/dchatc.rb
@@ -1,12 +1,12 @@
=begin
distributed Ruby --- chat client
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
class ChatClient
- include DRbUndumped
+ include DRbUndumped
def initialize(name)
@name = name
diff --git a/sample/drb/dchats.rb b/sample/drb/dchats.rb
index 012dfee..ccb2c7c 100644
--- a/sample/drb/dchats.rb
+++ b/sample/drb/dchats.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- chat server
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'thread'
require 'drb/drb'
diff --git a/sample/drb/dhasen.rb b/sample/drb/dhasen.rb
index fb1724a..651b9c6 100644
--- a/sample/drb/dhasen.rb
+++ b/sample/drb/dhasen.rb
@@ -1,13 +1,13 @@
=begin
distributed Ruby --- dRuby Sample Server --- chasen server
- Copyright (c) 1999-2001 Masatoshi SEKI
+ Copyright (c) 1999-2001 Masatoshi SEKI
=end
=begin
How to play.
Terminal 1
- | % ruby dhasen.rb
+ | % ruby dhasen.rb
| druby://yourhost:7640
Terminal 2
diff --git a/sample/drb/dhasenc.rb b/sample/drb/dhasenc.rb
index 2774feb..44e58ce 100644
--- a/sample/drb/dhasenc.rb
+++ b/sample/drb/dhasenc.rb
@@ -1,7 +1,7 @@
# -*- encoding: euc-jp -*-
=begin
distributed Ruby --- dRuby Sample Client -- chasen client
- Copyright (c) 1999-2001 Masatoshi SEKI
+ Copyright (c) 1999-2001 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/dlogc.rb b/sample/drb/dlogc.rb
index c75bc7b..3939a71 100644
--- a/sample/drb/dlogc.rb
+++ b/sample/drb/dlogc.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- Log test
- Copyright (c) 1999-2001 Masatoshi SEKI
+ Copyright (c) 1999-2001 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/dlogd.rb b/sample/drb/dlogd.rb
index 9f9aa2f..fef7ca0 100644
--- a/sample/drb/dlogd.rb
+++ b/sample/drb/dlogd.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- Log server
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/dqin.rb b/sample/drb/dqin.rb
index 3ba1caa..4751335 100644
--- a/sample/drb/dqin.rb
+++ b/sample/drb/dqin.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- store
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/dqout.rb b/sample/drb/dqout.rb
index 4700e55..f2b0b4a 100644
--- a/sample/drb/dqout.rb
+++ b/sample/drb/dqout.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- fetch
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/dqueue.rb b/sample/drb/dqueue.rb
index a5a4365..1c8878c 100644
--- a/sample/drb/dqueue.rb
+++ b/sample/drb/dqueue.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- Queue
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'thread'
diff --git a/sample/drb/drbc.rb b/sample/drb/drbc.rb
index 00132b4..50a86c3 100644
--- a/sample/drb/drbc.rb
+++ b/sample/drb/drbc.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- dRuby Sample Client
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/drbch.rb b/sample/drb/drbch.rb
index 495ff1c..07fdcd5 100644
--- a/sample/drb/drbch.rb
+++ b/sample/drb/drbch.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- dRuby Sample Client
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/drbm.rb b/sample/drb/drbm.rb
index 74a15a4..3390608 100644
--- a/sample/drb/drbm.rb
+++ b/sample/drb/drbm.rb
@@ -1,13 +1,13 @@
=begin
multiple DRbServer
- Copyright (c) 1999-2002 Masatoshi SEKI
+ Copyright (c) 1999-2002 Masatoshi SEKI
=end
=begin
How to play.
Terminal 1
- | % ruby drbm.rb
+ | % ruby drbm.rb
| druby://yourhost:7640 druby://yourhost:7641
Terminal 2
@@ -24,7 +24,7 @@ class Hoge
def initialize(s)
@str = s
end
-
+
def to_s
@str
end
diff --git a/sample/drb/drbmc.rb b/sample/drb/drbmc.rb
index c654fce..fd19140 100644
--- a/sample/drb/drbmc.rb
+++ b/sample/drb/drbmc.rb
@@ -1,6 +1,6 @@
=begin
multiple DRbServer client
- Copyright (c) 1999-2002 Masatoshi SEKI
+ Copyright (c) 1999-2002 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/drbs-acl.rb b/sample/drb/drbs-acl.rb
index 151dd94..71c4f7b 100644
--- a/sample/drb/drbs-acl.rb
+++ b/sample/drb/drbs-acl.rb
@@ -1,13 +1,13 @@
=begin
distributed Ruby --- dRuby Sample Server
- Copyright (c) 1999-2000 Masatoshi SEKI
+ Copyright (c) 1999-2000 Masatoshi SEKI
=end
=begin
How to play.
Terminal 1
- | % ruby drbs.rb
+ | % ruby drbs.rb
| druby://yourhost:7640
Terminal 2
@@ -41,7 +41,7 @@ if __FILE__ == $0
acl = ACL.new(%w(deny all
allow 192.168.1.*
allow localhost))
-
+
DRb.install_acl(acl)
DRb.start_service(nil, DRbEx.new)
diff --git a/sample/drb/drbs.rb b/sample/drb/drbs.rb
index b76e283..5a913d9 100644
--- a/sample/drb/drbs.rb
+++ b/sample/drb/drbs.rb
@@ -1,13 +1,13 @@
=begin
distributed Ruby --- dRuby Sample Server
- Copyright (c) 1999-2000,2002 Masatoshi SEKI
+ Copyright (c) 1999-2000,2002 Masatoshi SEKI
=end
=begin
How to play.
Terminal 1
- | % ruby drbs.rb
+ | % ruby drbs.rb
| druby://yourhost:7640
Terminal 2
diff --git a/sample/drb/extserv_test.rb b/sample/drb/extserv_test.rb
index 83d871a..2c4f485 100644
--- a/sample/drb/extserv_test.rb
+++ b/sample/drb/extserv_test.rb
@@ -1,11 +1,11 @@
=begin
dRuby sample
- Copyright (c) 2000 Masatoshi SEKI
+ Copyright (c) 2000 Masatoshi SEKI
= How to play
* Terminal 1
-
+
% ruby -I. extserv_test.rb server
druby://yourhost:12345
@@ -26,11 +26,11 @@ end
class Foo
include DRbUndumped
-
+
def initialize(str)
@str = str
end
-
+
def hello(it)
"#{it}: #{self}"
end
@@ -55,7 +55,7 @@ when 'server'
DRb::ExtServManager.command['itest1'] = "ruby -I. #{$0} itest1"
DRb::ExtServManager.command['itest2'] = "ruby -I. #{$0} itest2"
-
+
s = DRb::ExtServManager.new
DRb.start_service(ARGV.shift, s)
puts DRb.uri
@@ -72,7 +72,7 @@ else
t2 = s.service('itest2').front
puts t2
puts t1.hello(t2)
- if (cmd == 'quit')
+ if (cmd == 'quit')
s.service('itest1').stop_service
s.service('itest2').stop_service
end
diff --git a/sample/drb/holderc.rb b/sample/drb/holderc.rb
index 8dd72eb..e627916 100644
--- a/sample/drb/holderc.rb
+++ b/sample/drb/holderc.rb
@@ -11,7 +11,7 @@ DRb.start_service()
ro = DRbObject.new(nil, there)
ary = []
-10.times do
+10.times do
ary.push(ro.gen)
end
diff --git a/sample/drb/holders.rb b/sample/drb/holders.rb
index 2d9974f..293426f 100644
--- a/sample/drb/holders.rb
+++ b/sample/drb/holders.rb
@@ -14,7 +14,7 @@
% ruby holderc.rb druby://yourhost:1234
=end
-
+
require 'drb/drb'
@@ -36,11 +36,11 @@ end
class DRbEx4
include DRbUndumped
-
+
def initialize
@curr = 1
end
-
+
def gen
begin
@curr += 1
diff --git a/sample/drb/http0.rb b/sample/drb/http0.rb
index 7649925..d4c9f6b 100644
--- a/sample/drb/http0.rb
+++ b/sample/drb/http0.rb
@@ -46,14 +46,14 @@ module DRb
def close; end
def alive?; false; end
-
+
def send_request(ref, msg_id, *arg, &b)
stream = StrStream.new
@msg.send_request(stream, ref, msg_id, *arg, &b)
@reply_stream = StrStream.new
post(@uri, stream.buf)
end
-
+
def recv_reply
@msg.recv_reply(@reply_stream)
end
@@ -66,7 +66,7 @@ module DRb
http.post(path, data, {'Content-Type'=>'application/octetstream;'}) do |str|
sio.write(str)
if @config[:load_limit] < sio.buf.size
- raise TypeError, 'too large packet'
+ raise TypeError, 'too large packet'
end
end
@reply_stream = sio
diff --git a/sample/drb/http0serv.rb b/sample/drb/http0serv.rb
index 100d126..8318123 100644
--- a/sample/drb/http0serv.rb
+++ b/sample/drb/http0serv.rb
@@ -5,7 +5,7 @@ require 'thread'
module DRb
module HTTP0
-
+
def self.open_server(uri, config)
unless /^http:/ =~ uri
raise(DRbBadScheme, uri) unless uri =~ /^http:/
@@ -20,7 +20,7 @@ module DRb
@drb = drb
@queue = Queue.new
end
-
+
def do_POST(req, res)
@req = req
@res = res
@@ -28,7 +28,7 @@ module DRb
@res.body = @queue.pop
@res['content-type'] = 'application/octet-stream;'
end
-
+
def req_body
@req.body
end
@@ -36,7 +36,7 @@ module DRb
def reply(body)
@queue.push(body)
end
-
+
def close
@queue.push('')
end
@@ -78,7 +78,7 @@ module DRb
s.start
end
end
-
+
class ServerSide
def initialize(callback, config)
@callback = callback
@@ -86,7 +86,7 @@ module DRb
@msg = DRbMessage.new(@config)
@req_stream = StrStream.new(@callback.req_body)
end
-
+
def close
@callback.close if @callback
@callback = nil
diff --git a/sample/drb/name.rb b/sample/drb/name.rb
index 86b478f..9527d47 100644
--- a/sample/drb/name.rb
+++ b/sample/drb/name.rb
@@ -1,12 +1,12 @@
=begin
distributed Ruby --- NamedObject Sample
- Copyright (c) 2000-2001 Masatoshi SEKI
+ Copyright (c) 2000-2001 Masatoshi SEKI
=end
=begin
How to play.
-* start server
+* start server
Terminal 1
| % ruby name.rb druby://yourhost:7640
| druby://yourhost:7640
@@ -28,9 +28,9 @@ How to play.
| druby://yourhost:7640
| [return] to exit
-* continue client
+* continue client
Terminal 2
- type [return]
+ type [return]
| 1
| 2
=end
@@ -44,7 +44,7 @@ module DRbNamedObject
def drb_name=(name)
@drb_name = name
- Thread.exclusive do
+ Thread.exclusive do
raise(IndexError, name) if DRbNAMEDICT[name]
DRbNAMEDICT[name] = self
end
@@ -62,7 +62,7 @@ class DRbNamedIdConv < DRb::DRbIdConv
def to_id(obj)
if obj.kind_of? DRbNamedObject
- return obj.drb_name
+ return obj.drb_name
else
return super
end
@@ -98,7 +98,7 @@ class Front
@name['seq'] = seq
@name['mutex'] = mutex
end
-
+
def [](k)
@name[k]
end
@@ -108,7 +108,7 @@ if __FILE__ == $0
uri = ARGV.shift
name_conv = DRbNamedIdConv.new
-
+
DRb.install_id_conv(name_conv)
DRb.start_service(uri, Front.new)
puts DRb.uri
diff --git a/sample/drb/namec.rb b/sample/drb/namec.rb
index f6db6f3..98b9d0e 100644
--- a/sample/drb/namec.rb
+++ b/sample/drb/namec.rb
@@ -1,6 +1,6 @@
=begin
distributed Ruby --- NamedObject Sample Client
- Copyright (c) 2000-2001 Masatoshi SEKI
+ Copyright (c) 2000-2001 Masatoshi SEKI
=end
require 'drb/drb'
diff --git a/sample/drb/old_tuplespace.rb b/sample/drb/old_tuplespace.rb
index 3e13b92..0da9fa8 100644
--- a/sample/drb/old_tuplespace.rb
+++ b/sample/drb/old_tuplespace.rb
@@ -82,7 +82,7 @@ class TupleSpace
end
end
return nil unless found
-
+
@que[sz].delete_at(i)
return x
@@ -167,7 +167,7 @@ if __FILE__ == $0
def client(ts, n)
Thread.start {
ac = Object.new
- tuples = (1..10).collect { |i|
+ tuples = (1..10).collect { |i|
['req', ac, i * 10 + n]
}
ts.out(*tuples)
@@ -201,7 +201,7 @@ if __FILE__ == $0
clients.push(client(ts, n))
end
- (1..3).each do
+ (1..3).each do
watcher(ts)
end
diff --git a/sample/drb/ring_echo.rb b/sample/drb/ring_echo.rb
index 0633aa8..3b743ca 100644
--- a/sample/drb/ring_echo.rb
+++ b/sample/drb/ring_echo.rb
@@ -8,7 +8,7 @@ class RingEcho
def initialize(name)
@name = name
end
-
+
def echo(str)
"#{@name}: #{str}"
end
diff --git a/sample/drb/simpletuple.rb b/sample/drb/simpletuple.rb
index 3ae9208..1b9b7a3 100644
--- a/sample/drb/simpletuple.rb
+++ b/sample/drb/simpletuple.rb
@@ -13,7 +13,7 @@ class SimpleTupleSpace
@waiting.taint
self.taint
end
-
+
def out(key, obj)
Thread.critical = true
@hash[key] ||= []
@@ -48,7 +48,7 @@ class SimpleTupleSpace
Thread.critical = false
end
end
-end
+end
if __FILE__ == $0
ts = SimpleTupleSpace.new
@@ -75,7 +75,7 @@ if __FILE__ == $0
}
end
- 3.times do
+ 3.times do
servers.push(server(ts))
end
diff --git a/sample/drb/speedc.rb b/sample/drb/speedc.rb
index 14d526d..64b8a65 100644
--- a/sample/drb/speedc.rb
+++ b/sample/drb/speedc.rb
@@ -11,7 +11,7 @@ when /^tcpromp:/, /^unixromp:/
foo = client.resolve("foo")
when /^druby:/
require 'drb/drb'
-
+
DRb.start_service
foo = DRbObject.new(nil, uri)
end
diff --git a/sample/drb/speeds.rb b/sample/drb/speeds.rb
index 76b4b29..7984059 100644
--- a/sample/drb/speeds.rb
+++ b/sample/drb/speeds.rb
@@ -3,7 +3,7 @@ class Foo
def initialize
@i = 0
end
-
+
def foo(i)
@i = i
i + i
@@ -24,7 +24,7 @@ when /^tcpromp:/, /^unixromp:/
when /^druby:/
require 'drb/drb'
-
+
DRb.start_service(uri, Foo.new)
end