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

ruby-changes:20233

From: drbrain <ko1@a...>
Date: Wed, 29 Jun 2011 12:09:48 +0900 (JST)
Subject: [ruby-changes:20233] drbrain:r32281 (trunk): * math.c: Attach documentation for Math.

drbrain	2011-06-29 12:09:34 +0900 (Wed, 29 Jun 2011)

  New Revision: 32281

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

  Log:
    * math.c:  Attach documentation for Math.
    * object.c:  Document NIL, TRUE, FALSE.
    * io.c:  Improve grammar in ARGF comment.  Document STDIN/OUT/ERR.
      Document ARGF global constant.
    * lib/rake:  Hide deprecated toplevel constants from RDoc (import from
      rake trunk).
    * lib/thwait.rb:  Document ThWait.
    * lib/mathn.rb:  Hide Math redefinition from RDoc
    * lib/sync.rb:  Add a basic comment for Sync_m, Synchronizer_m, Sync,
      Synchronizer.
    * parse.y:  Document SCRIPT_LINES__.
    * hash.c:  Document ENV class and global constant.
    * vm.c:  Document TOPLEVEL_BINDING.
    * version.c:  Document RUBY_* constants.
    * ruby.c:  Document DATA and ARGV.

  Modified files:
    trunk/ChangeLog
    trunk/hash.c
    trunk/io.c
    trunk/lib/mathn.rb
    trunk/lib/rake/contrib/publisher.rb
    trunk/lib/rake.rb
    trunk/lib/sync.rb
    trunk/lib/thwait.rb
    trunk/math.c
    trunk/object.c
    trunk/parse.y
    trunk/ruby.c
    trunk/version.c
    trunk/vm.c

Index: math.c
===================================================================
--- math.c	(revision 32280)
+++ math.c	(revision 32281)
@@ -760,6 +760,8 @@
  */
 
 /*
+ *  Document-class: Math
+ *
  *  The <code>Math</code> module contains module functions for basic
  *  trigonometric and transcendental functions. See class
  *  <code>Float</code> for a list of constants that
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32280)
+++ ChangeLog	(revision 32281)
@@ -1,3 +1,21 @@
+Wed Jun 29 12:07:27 2011  Eric Hodel  <drbrain@s...>
+
+	* math.c:  Attach documentation for Math.
+	* object.c:  Document NIL, TRUE, FALSE.
+	* io.c:  Improve grammar in ARGF comment.  Document STDIN/OUT/ERR.
+	  Document ARGF global constant.
+	* lib/rake:  Hide deprecated toplevel constants from RDoc (import from
+	  rake trunk).
+	* lib/thwait.rb:  Document ThWait.
+	* lib/mathn.rb:  Hide Math redefinition from RDoc
+	* lib/sync.rb:  Add a basic comment for Sync_m, Synchronizer_m, Sync,
+	  Synchronizer.
+	* parse.y:  Document SCRIPT_LINES__.
+	* hash.c:  Document ENV class and global constant.
+	* vm.c:  Document TOPLEVEL_BINDING.
+	* version.c:  Document RUBY_* constants.
+	* ruby.c:  Document DATA and ARGV.
+
 Wed Jun 29 10:13:12 2011  Marc-Andre Lafortune  <ruby-core@m...>
 
 	* lib/matrix.rb: Matrix.zero can build rectangular matrices.
Index: object.c
===================================================================
--- object.c	(revision 32280)
+++ object.c	(revision 32281)
@@ -2677,6 +2677,9 @@
     rb_define_method(rb_cNilClass, "nil?", rb_true, 0);
     rb_undef_alloc_func(rb_cNilClass);
     rb_undef_method(CLASS_OF(rb_cNilClass), "new");
+    /*
+     * An alias of +nil+
+     */
     rb_define_global_const("NIL", Qnil);
 
     rb_define_method(rb_cModule, "freeze", rb_mod_freeze, 0);
@@ -2746,6 +2749,9 @@
     rb_define_method(rb_cTrueClass, "^", true_xor, 1);
     rb_undef_alloc_func(rb_cTrueClass);
     rb_undef_method(CLASS_OF(rb_cTrueClass), "new");
+    /*
+     * An alias of +true+
+     */
     rb_define_global_const("TRUE", Qtrue);
 
     rb_cFalseClass = rb_define_class("FalseClass", rb_cObject);
@@ -2755,6 +2761,9 @@
     rb_define_method(rb_cFalseClass, "^", false_xor, 1);
     rb_undef_alloc_func(rb_cFalseClass);
     rb_undef_method(CLASS_OF(rb_cFalseClass), "new");
+    /*
+     * An alias of +false+
+     */
     rb_define_global_const("FALSE", Qfalse);
 
     id_eq = rb_intern("==");
Index: io.c
===================================================================
--- io.c	(revision 32280)
+++ io.c	(revision 32281)
@@ -10320,7 +10320,7 @@
  * Document-class:  ARGF
  *
  * +ARGF+ is a stream designed for use in scripts that process files given as
- * command-line arguments, or passed in via STDIN.
+ * command-line arguments or passed in via STDIN.
  *
  * The arguments passed to your script are stored in the +ARGV+ Array, one
  * argument per element. +ARGF+ assumes that any arguments that aren't
@@ -10336,7 +10336,7 @@
  * files. For instance, +ARGF.read+ will return the contents of _file1_
  * followed by the contents of _file2_.
  *
- * After a file in +ARGV+ has been read, +ARGF+ removes it from the Array.
+ * After a file in +ARGV+ has been read +ARGF+ removes it from the Array.
  * Thus, after all files have been read +ARGV+ will be empty.
  *
  * You can manipulate +ARGV+ yourself to control what +ARGF+ operates on. If
@@ -10628,9 +10628,11 @@
     orig_stdout = rb_stdout;
     rb_deferr = orig_stderr = rb_stderr;
 
-    /* constants to hold original stdin/stdout/stderr */
+    /* Holds the original stdin */
     rb_define_global_const("STDIN", rb_stdin);
+    /* Holds the original stdout */
     rb_define_global_const("STDOUT", rb_stdout);
+    /* Holds the original stderr */
     rb_define_global_const("STDERR", rb_stderr);
 
     /*
@@ -10707,6 +10709,12 @@
     argf = rb_class_new_instance(0, 0, rb_cARGF);
 
     rb_define_readonly_variable("$<", &argf);
+    /*
+     * ARGF is a stream designed for use in scripts that process files given
+     * as command-line arguments or passed in via STDIN.
+     *
+     * See ARGF (the class) for more details.
+     */
     rb_define_global_const("ARGF", argf);
 
     rb_define_hooked_variable("$.", &argf, argf_lineno_getter, argf_lineno_setter);
Index: lib/rake/contrib/publisher.rb
===================================================================
--- lib/rake/contrib/publisher.rb	(revision 32280)
+++ lib/rake/contrib/publisher.rb	(revision 32281)
@@ -1,15 +1,19 @@
 # Copyright 2003-2010 by Jim Weirich (jim.weirich@g...)
 # All rights reserved.
 
+# :stopdoc:
+
 # Configuration information about an upload host system.
-# * name   :: Name of host system.
-# * webdir :: Base directory for the web information for the
-#             application.  The application name (APP) is appended to
-#             this directory before using.
-# * pkgdir :: Directory on the host system where packages can be
-#             placed.
+# name   :: Name of host system.
+# webdir :: Base directory for the web information for the
+#           application.  The application name (APP) is appended to
+#           this directory before using.
+# pkgdir :: Directory on the host system where packages can be
+#           placed.
 HostInfo = Struct.new(:name, :webdir, :pkgdir)
 
+# :startdoc:
+
 # Manage several publishers as a single entity.
 class CompositePublisher
   def initialize
Index: lib/thwait.rb
===================================================================
--- lib/thwait.rb	(revision 32280)
+++ lib/thwait.rb	(revision 32281)
@@ -131,13 +131,12 @@
   end
 end
 
+##
+# An alias for ThreadsWait from thwait.rb
+
 ThWait = ThreadsWait
 
-
 # Documentation comments:
 #  - Source of documentation is evenly split between Nutshell, existing
 #    comments, and my own rephrasing.
 #  - I'm not particularly confident that the comments are all exactly correct.
-#  - The history, etc., up the top appears in the RDoc output.  Perhaps it would
-#    be better to direct that not to appear, and put something else there
-#    instead.
Index: lib/mathn.rb
===================================================================
--- lib/mathn.rb	(revision 32280)
+++ lib/mathn.rb	(revision 32281)
@@ -49,7 +49,7 @@
 
 unless defined?(Math.exp!)
   Object.instance_eval{remove_const :Math}
-  Math = CMath
+  Math = CMath # :nodoc:
 end
 
 ##
Index: lib/rake.rb
===================================================================
--- lib/rake.rb	(revision 32280)
+++ lib/rake.rb	(revision 32281)
@@ -61,6 +61,8 @@
 
 $trace = false
 
+# :stopdoc:
+#
 # Some top level Constants.
 
 FileList = Rake::FileList
Index: lib/sync.rb
===================================================================
--- lib/sync.rb	(revision 32280)
+++ lib/sync.rb	(revision 32281)
@@ -41,6 +41,9 @@
   raise "Thread not available for this ruby interpreter"
 end
 
+##
+# A module that provides a two-phase lock with a counter.
+
 module Sync_m
   RCS_ID='-$Id$-'
 
@@ -298,9 +301,21 @@
     return ret
   end
 end
+
+##
+# An alias for Sync_m from sync.rb
+
 Synchronizer_m = Sync_m
 
+##
+# A class that providesa two-phase lock with a counter.  See Sync_m for
+# details.
+
 class Sync
   include Sync_m
 end
+
+##
+# An alias for Sync from sync.rb.  See Sync_m for details.
+
 Synchronizer = Sync
Index: parse.y
===================================================================
--- parse.y	(revision 32280)
+++ parse.y	(revision 32281)
@@ -10750,5 +10750,17 @@
     /* ensure existing in symbol table */
     (void)rb_intern("||");
     (void)rb_intern("&&");
+
+# if 0
+    /* Hack to let RDoc document SCRIPT_LINES__ */
+
+    /*
+     * When a Hash is assigned to +SCRIPT_LINES__+ the contents of files loaded
+     * after the assignment will be added as an Array of lines with the file
+     * name as the key.
+     */
+    rb_define_global_const("SCRIPT_LINES__", Qnil);
+#endif
+
 }
 #endif /* RIPPER */
Index: hash.c
===================================================================
--- hash.c	(revision 32280)
+++ hash.c	(revision 32281)
@@ -2974,6 +2974,15 @@
     rb_define_method(rb_cHash,"compare_by_identity", rb_hash_compare_by_id, 0);
     rb_define_method(rb_cHash,"compare_by_identity?", rb_hash_compare_by_id_p, 0);
 
+    /* Document-class: ENV
+     *
+     * ENV is a hash-like accessor for environment variables.
+     */
+
+    /*
+     * Hack to get RDoc to regard ENV as a class:
+     * envtbl = rb_define_class("ENV", rb_cObject);
+     */
     origenviron = environ;
     envtbl = rb_obj_alloc(rb_cObject);
     rb_extend_object(envtbl, rb_mEnumerable);
@@ -3020,5 +3029,10 @@
     rb_define_singleton_method(envtbl,"assoc", env_assoc, 1);
     rb_define_singleton_method(envtbl,"rassoc", env_rassoc, 1);
 
+    /*
+     * ENV is a Hash-like accessor for environment variables.
+     *
+     * See ENV (the class) for more details.
+     */
     rb_define_global_const("ENV", envtbl);
 }
Index: vm.c
===================================================================
--- vm.c	(revision 32280)
+++ vm.c	(revision 32281)
@@ -2128,6 +2128,9 @@
 	th->cfp->pc = iseq->iseq_encoded;
 	th->cfp->self = th->top_self;
 
+	/*
+	 * The Binding of the top level scope
+	 */
 	rb_define_global_const("TOPLEVEL_BINDING", rb_binding_new());
     }
     vm_init_redefined_flag();
Index: version.c
===================================================================
--- version.c	(revision 32280)
+++ version.c	(revision 32281)
@@ -98,13 +98,38 @@
 void
 Init_version(void)
 {
+    /*
+     * The running version of ruby
+     */
     rb_define_global_const("RUBY_VERSION", MKSTR(version));
+    /*
+     * The date this ruby was released
+     */
     rb_define_global_const("RUBY_RELEASE_DATE", MKSTR(release_date));
+    /*
+     * The platform for this ruby
+     */
     rb_define_global_const("RUBY_PLATFORM", MKSTR(platform));
+    /*
+     * The patchlevel for this ruby.  If this is a development build of ruby
+     * the patchlevel will be -1
+     */
     rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
+    /*
+     * The SVN revision for this ruby.
+     */
     rb_define_global_const("RUBY_REVISION", INT2FIX(RUBY_REVISION));
+    /*
+     * The full ruby version string, like <tt>ruby -v</tt> prints'
+     */
     rb_define_global_const("RUBY_DESCRIPTION", MKSTR(description));
+    /*
+     * The copyright string for ruby
+     */
     rb_define_global_const("RUBY_COPYRIGHT", MKSTR(copyright));
+    /*
+     * The engine or interpreter this ruby uses.
+     */
     rb_define_global_const("RUBY_ENGINE", ruby_engine_name = MKSTR(engine));
 }
 
Index: ruby.c
===================================================================
--- ruby.c	(revision 32280)
+++ ruby.c	(revision 32281)
@@ -1625,6 +1625,18 @@
     tree = rb_parser_compile_file(parser, fname, f, line_start);
     rb_funcall(f, set_encoding, 1, rb_parser_encoding(parser));
     if (script && tree && rb_parser_end_seen_p(parser)) {
+	/*
+	 * DATA is a File that contains the data section of the executed file.
+	 * To create a data section use <tt>__END__</tt>:
+	 *
+	 *   $ cat t.rb
+	 *   puts DATA.gets
+	 *   __END__
+	 *   hello world!
+	 *
+	 *   $ ruby t.rb
+	 *   hello world!
+	 */
 	rb_define_global_const("DATA", f);
     }
     else if (f != rb_stdin) {
@@ -1746,6 +1758,13 @@
     rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0);
     rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0);
 
+    /*
+     * ARGV contains the command line arguments used to run ruby with the
+     * first value containing the name of the executable.
+     *
+     * A library like OptionParser can be used to process command-line
+     * arguments.
+     */
     rb_define_global_const("ARGV", rb_argv);
 }
 

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

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