summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-29 03:09:34 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-29 03:09:34 +0000
commit926301969f7970b5a59a065dabb234cddc590e6c (patch)
tree1962225c402f5ed2c75ed14b1eece1dd665fd0b4 /io.c
parent54bbc098fa1e05570e960750bf2c86d45017e575 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/io.c b/io.c
index 4371d5388a..7900ab6638 100644
--- a/io.c
+++ b/io.c
@@ -10320,7 +10320,7 @@ argf_write(VALUE argf, VALUE str)
* 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 @@ argf_write(VALUE argf, VALUE str)
* 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 @@ Init_IO(void)
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 @@ Init_IO(void)
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);