[前][次][番号順一覧][スレッド一覧]

ruby-changes:35154

From: hsbt <ko1@a...>
Date: Thu, 21 Aug 2014 13:24:08 +0900 (JST)
Subject: [ruby-changes:35154] hsbt:r47236 (trunk): * lib/rinda/ring.rb: split executable code into sample directory.

hsbt	2014-08-21 13:23:56 +0900 (Thu, 21 Aug 2014)

  New Revision: 47236

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47236

  Log:
    * lib/rinda/ring.rb: split executable code into sample directory.
    * sample/rinda-ring.rb: ditto.

  Added files:
    trunk/sample/rinda-ring.rb
  Modified files:
    trunk/ChangeLog
    trunk/lib/rinda/ring.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47235)
+++ ChangeLog	(revision 47236)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Aug 21 13:23:34 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* lib/rinda/ring.rb: split executable code into sample directory.
+	* sample/rinda-ring.rb: ditto.
+
 Thu Aug 21 13:21:45 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* lib/drb/acl.rb: split executable code into sample directory.
Index: sample/rinda-ring.rb
===================================================================
--- sample/rinda-ring.rb	(revision 0)
+++ sample/rinda-ring.rb	(revision 47236)
@@ -0,0 +1,22 @@ https://github.com/ruby/ruby/blob/trunk/sample/rinda-ring.rb#L1
+require 'rinda/ring'
+
+DRb.start_service
+case ARGV.shift
+when 's'
+  require 'rinda/tuplespace'
+  ts = Rinda::TupleSpace.new
+  Rinda::RingServer.new(ts)
+  $stdin.gets
+when 'w'
+  finger = Rinda::RingFinger.new(nil)
+  finger.lookup_ring do |ts2|
+    p ts2
+    ts2.write([:hello, :world])
+  end
+when 'r'
+  finger = Rinda::RingFinger.new(nil)
+  finger.lookup_ring do |ts2|
+    p ts2
+    p ts2.take([nil, nil])
+  end
+end
Index: lib/rinda/ring.rb
===================================================================
--- lib/rinda/ring.rb	(revision 47235)
+++ lib/rinda/ring.rb	(revision 47236)
@@ -478,27 +478,3 @@ module Rinda https://github.com/ruby/ruby/blob/trunk/lib/rinda/ring.rb#L478
   end
 
 end
-
-if __FILE__ == $0
-  DRb.start_service
-  case ARGV.shift
-  when 's'
-    require 'rinda/tuplespace'
-    ts = Rinda::TupleSpace.new
-    Rinda::RingServer.new(ts)
-    $stdin.gets
-  when 'w'
-    finger = Rinda::RingFinger.new(nil)
-    finger.lookup_ring do |ts2|
-      p ts2
-      ts2.write([:hello, :world])
-    end
-  when 'r'
-    finger = Rinda::RingFinger.new(nil)
-    finger.lookup_ring do |ts2|
-      p ts2
-      p ts2.take([nil, nil])
-    end
-  end
-end
-

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]