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

ruby-changes:34834

From: hsbt <ko1@a...>
Date: Thu, 24 Jul 2014 04:31:38 +0900 (JST)
Subject: [ruby-changes:34834] hsbt:r46917 (trunk): * lib/pstore.rb: split executable code into sample directory.

hsbt	2014-07-24 04:31:18 +0900 (Thu, 24 Jul 2014)

  New Revision: 46917

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

  Log:
    * lib/pstore.rb: split executable code into sample directory.
    * sample/pstore.rb: ditto.

  Added files:
    trunk/sample/pstore.rb
  Modified files:
    trunk/ChangeLog
    trunk/lib/pstore.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46916)
+++ ChangeLog	(revision 46917)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jul 24 04:29:36 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* lib/pstore.rb: split executable code into sample directory.
+	* sample/pstore.rb: ditto.
+
 Wed Jul 23 23:50:11 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/defines.h, siphash.c, st.c (UNALIGNED_WORD_ACCESS):
Index: sample/pstore.rb
===================================================================
--- sample/pstore.rb	(revision 0)
+++ sample/pstore.rb	(revision 46917)
@@ -0,0 +1,19 @@ https://github.com/ruby/ruby/blob/trunk/sample/pstore.rb#L1
+require 'pstore'
+
+db = PStore.new("/tmp/foo")
+db.transaction do
+  p db.roots
+  ary = db["root"] = [1,2,3,4]
+  ary[1] = [1,1.5]
+end
+
+1000.times do
+  db.transaction do
+    db["root"][0] += 1
+    p db["root"][0]
+  end
+end
+
+db.transaction(true) do
+  p db["root"]
+end
Index: lib/pstore.rb
===================================================================
--- lib/pstore.rb	(revision 46916)
+++ lib/pstore.rb	(revision 46917)
@@ -482,25 +482,3 @@ class PStore https://github.com/ruby/ruby/blob/trunk/lib/pstore.rb#L482
     EMPTY_MARSHAL_CHECKSUM
   end
 end
-
-# :enddoc:
-
-if __FILE__ == $0
-  db = PStore.new("/tmp/foo")
-  db.transaction do
-    p db.roots
-    ary = db["root"] = [1,2,3,4]
-    ary[1] = [1,1.5]
-  end
-
-  1000.times do
-    db.transaction do
-      db["root"][0] += 1
-      p db["root"][0]
-    end
-  end
-
-  db.transaction(true) do
-    p db["root"]
-  end
-end

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

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