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

ruby-changes:26997

From: zzak <ko1@a...>
Date: Tue, 5 Feb 2013 08:05:05 +0900 (JST)
Subject: [ruby-changes:26997] zzak:r39049 (trunk): * lib/irb.rb, lib/irb/ext/save-history.rb: Add documentation on how to

zzak	2013-02-05 08:04:09 +0900 (Tue, 05 Feb 2013)

  New Revision: 39049

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

  Log:
    * lib/irb.rb, lib/irb/ext/save-history.rb: Add documentation on how to
      enabled irb history [ruby-core:51347] [Bug #7679]

  Modified files:
    trunk/ChangeLog
    trunk/lib/irb/ext/save-history.rb
    trunk/lib/irb.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39048)
+++ ChangeLog	(revision 39049)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Feb  5 08:03:00 2013  Zachary Scott  <zachary@z...>
+
+	* lib/irb.rb, lib/irb/ext/save-history.rb: Add documentation on how to
+	  enabled irb history [ruby-core:51347] [Bug #7679]
+
 Tue Feb  5 07:35:00 2013  Zachary Scott  <zachary@z...>
 
 	* lib/irb.rb, lib/irb/context.rb: Add documentation on how to enable
Index: lib/irb/ext/save-history.rb
===================================================================
--- lib/irb/ext/save-history.rb	(revision 39048)
+++ lib/irb/ext/save-history.rb	(revision 39049)
@@ -29,6 +29,13 @@ module IRB https://github.com/ruby/ruby/blob/trunk/lib/irb/ext/save-history.rb#L29
 
     # Sets <code>IRB.conf[:SAVE_HISTORY]</code> to the given +val+ and calls
     # #init_save_history with this context.
+    #
+    # Will store the number of +val+ entries of history in the #history_file
+    #
+    # Add the following to your +.irbrc+ to change the number of history
+    # entries stored to 1000:
+    #
+    #     IRB.conf[:SAVE_HISTORY] = 1000
     def save_history=(val)
       IRB.conf[:SAVE_HISTORY] = val
       if val
Index: lib/irb.rb
===================================================================
--- lib/irb.rb	(revision 39048)
+++ lib/irb.rb	(revision 39049)
@@ -117,6 +117,18 @@ STDOUT.sync = true https://github.com/ruby/ruby/blob/trunk/lib/irb.rb#L117
 #
 #     require 'irb/completion'
 #
+# === History
+#
+# By default, irb disables history and will not store any commands you used.
+#
+# If you want to enable history, add the following to your +.irbrc+:
+#
+#     IRB.conf[:SAVE_HISTORY] = 1000
+#
+# This will now store the last 1000 commands in <code>~/.irb_history</code>.
+#
+# See IRB::Context#save_history= for more information.
+#
 # == Customizing the IRB Prompt
 #
 # In order to customize the prompt, you can change the following Hash:

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

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