summaryrefslogtreecommitdiff
path: root/lib/rinda
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-06 03:56:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-06 03:56:38 +0000
commit287a34ae0dfc23e4158f67cb7783d239f202c368 (patch)
tree5e35d5b41aae961b37cf6632f60c42f51c7aa775 /lib/rinda
parent9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff)
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rinda')
-rw-r--r--lib/rinda/rinda.rb18
-rw-r--r--lib/rinda/ring.rb8
-rw-r--r--lib/rinda/tuplespace.rb18
3 files changed, 22 insertions, 22 deletions
diff --git a/lib/rinda/rinda.rb b/lib/rinda/rinda.rb
index 6c59e68654..18e284a544 100644
--- a/lib/rinda/rinda.rb
+++ b/lib/rinda/rinda.rb
@@ -58,7 +58,7 @@ module Rinda
##
# The number of elements in the tuple.
-
+
def size
@tuple.size
end
@@ -162,7 +162,7 @@ module Rinda
end
return true
end
-
+
##
# Alias for #match.
@@ -171,7 +171,7 @@ module Rinda
end
end
-
+
##
# <i>Documentation?</i>
@@ -184,7 +184,7 @@ module Rinda
@drb_uri = uri
@drb_ref = ref
end
-
+
##
# This DRbObjectTemplate matches +ro+ if the remote object's drburi and
# drbref are the same. +nil+ is used as a wildcard.
@@ -213,14 +213,14 @@ module Rinda
def initialize(ts)
@ts = ts
end
-
+
##
# Adds +tuple+ to the proxied TupleSpace. See TupleSpace#write.
def write(tuple, sec=nil)
@ts.write(tuple, sec)
end
-
+
##
# Takes +tuple+ from the proxied TupleSpace. See TupleSpace#take.
@@ -229,14 +229,14 @@ module Rinda
@ts.move(DRbObject.new(port), tuple, sec, &block)
port[0]
end
-
+
##
# Reads +tuple+ from the proxied TupleSpace. See TupleSpace#read.
def read(tuple, sec=nil, &block)
@ts.read(tuple, sec, &block)
end
-
+
##
# Reads all tuples matching +tuple+ from the proxied TupleSpace. See
# TupleSpace#read_all.
@@ -244,7 +244,7 @@ module Rinda
def read_all(tuple)
@ts.read_all(tuple)
end
-
+
##
# Registers for notifications of event +ev+ on the proxied TupleSpace.
# See TupleSpace#notify
diff --git a/lib/rinda/ring.rb b/lib/rinda/ring.rb
index 4dc7c7d79a..b25fd99856 100644
--- a/lib/rinda/ring.rb
+++ b/lib/rinda/ring.rb
@@ -49,7 +49,7 @@ module Rinda
end
end
end
-
+
##
# Extracts the response URI from +msg+ and adds it to TupleSpace where it
# will be picked up by +reply_service+ for notification.
@@ -74,7 +74,7 @@ module Rinda
end
end
end
-
+
##
# Pulls lookup tuples out of the TupleSpace and sends their DRb object the
# address of the local TupleSpace.
@@ -104,7 +104,7 @@ module Rinda
# created RingFinger.
def self.finger
- unless @@finger
+ unless @@finger
@@finger = self.new
@@finger.lookup_ring_any
end
@@ -207,7 +207,7 @@ module Rinda
@rings.push(it)
end
end
-
+
@primary = queue.pop
raise('RingNotFound') if @primary.nil?
@primary
diff --git a/lib/rinda/tuplespace.rb b/lib/rinda/tuplespace.rb
index 6ca30a7b4b..113aa0de15 100644
--- a/lib/rinda/tuplespace.rb
+++ b/lib/rinda/tuplespace.rb
@@ -73,14 +73,14 @@ module Rinda
end
##
- # Reset the expiry time according to +sec_or_renewer+.
+ # Reset the expiry time according to +sec_or_renewer+.
#
# +nil+:: it is set to expire in the far future.
# +false+:: it has expired.
# Numeric:: it will expire in that many seconds.
#
# Otherwise the argument refers to some kind of renewer object
- # which will reset its expiry time.
+ # which will reset its expiry time.
def renew(sec_or_renewer)
sec, @renewer = get_renewer(sec_or_renewer)
@@ -168,7 +168,7 @@ module Rinda
def match(tuple)
@tuple.match(tuple)
end
-
+
alias === match
def make_tuple(ary) # :nodoc:
@@ -224,11 +224,11 @@ module Rinda
#
# ts = Rinda::TupleSpace.new
# observer = ts.notify 'write', [nil]
- #
+ #
# Thread.start do
# observer.each { |t| p t }
# end
- #
+ #
# 3.times { |i| ts.write [i] }
#
# Outputs:
@@ -276,7 +276,7 @@ module Rinda
it = pop
yield(it)
end
- rescue
+ rescue
ensure
cancel
end
@@ -295,16 +295,16 @@ module Rinda
def initialize
@bin = []
end
-
+
def add(tuple)
@bin.push(tuple)
end
-
+
def delete(tuple)
idx = @bin.rindex(tuple)
@bin.delete_at(idx) if idx
end
-
+
def find(&blk)
@bin.reverse_each do |x|
return x if yield(x)