Skip to content

Commit 56557ec

Browse files
committed
[DOC] fix markups [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent c671f83 commit 56557ec

File tree

15 files changed

+450
-482
lines changed

15 files changed

+450
-482
lines changed

ast.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ ast_parse_done(rb_ast_t *ast)
7777
* call-seq:
7878
* RubyVM::AbstractSyntaxTree.parse(string) -> RubyVM::AbstractSyntaxTree::Node
7979
*
80-
* Parses the given string into an abstract syntax tree,
80+
* Parses the given _string_ into an abstract syntax tree,
8181
* returning the root node of that tree.
8282
*
83-
* SyntaxError is raised if the given string is invalid syntax.
83+
* SyntaxError is raised if the given _string_ is invalid syntax.
8484
*
8585
* RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
8686
* # => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:0, 1:9): >
@@ -105,10 +105,10 @@ rb_ast_parse_str(VALUE str)
105105
* call-seq:
106106
* RubyVM::AbstractSyntaxTree.parse_file(pathname) -> RubyVM::AbstractSyntaxTree::Node
107107
*
108-
* Reads the file from <code>pathname</code>, then parses it like ::parse,
108+
* Reads the file from _pathname_, then parses it like ::parse,
109109
* returning the root node of the abstract syntax tree.
110110
*
111-
* SyntaxError is raised if <code>pathname</code>'s contents are not
111+
* SyntaxError is raised if _pathname_'s contents are not
112112
* valid Ruby syntax.
113113
*
114114
* RubyVM::AbstractSyntaxTree.parse_file("my-app/app.rb")
@@ -205,7 +205,7 @@ script_lines(VALUE path)
205205
* RubyVM::AbstractSyntaxTree.of(proc) -> RubyVM::AbstractSyntaxTree::Node
206206
* RubyVM::AbstractSyntaxTree.of(method) -> RubyVM::AbstractSyntaxTree::Node
207207
*
208-
* Returns AST nodes of the given proc or method.
208+
* Returns AST nodes of the given _proc_ or _method_.
209209
*
210210
* RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
211211
* # => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:35, 1:42): >

bignum.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5500,8 +5500,8 @@ rb_big_le(VALUE x, VALUE y)
55005500
* big == obj -> true or false
55015501
*
55025502
* Returns <code>true</code> only if <i>obj</i> has the same value
5503-
* as <i>big</i>. Contrast this with <code>Integer#eql?</code>, which
5504-
* requires <i>obj</i> to be a <code>Integer</code>.
5503+
* as <i>big</i>. Contrast this with Integer#eql?, which requires
5504+
* <i>obj</i> to be a Integer.
55055505
*
55065506
* 68719476736 == 68719476736.0 #=> true
55075507
*/

compar.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,16 @@ cmp_clamp(VALUE x, VALUE min, VALUE max)
207207
}
208208

209209
/*
210-
* The <code>Comparable</code> mixin is used by classes whose objects
211-
* may be ordered. The class must define the <code><=></code> operator,
212-
* which compares the receiver against another object, returning -1, 0,
213-
* or +1 depending on whether the receiver is less than, equal to, or
214-
* greater than the other object. If the other object is not comparable
215-
* then the <code><=></code> operator should return nil.
216-
* <code>Comparable</code> uses
217-
* <code><=></code> to implement the conventional comparison operators
218-
* (<code><</code>, <code><=</code>, <code>==</code>, <code>>=</code>,
219-
* and <code>></code>) and the method <code>between?</code>.
210+
* The Comparable mixin is used by classes whose objects may be
211+
* ordered. The class must define the <code><=></code> operator,
212+
* which compares the receiver against another object, returning -1,
213+
* 0, or +1 depending on whether the receiver is less than, equal to,
214+
* or greater than the other object. If the other object is not
215+
* comparable then the <code><=></code> operator should return +nil+.
216+
* Comparable uses <code><=></code> to implement the conventional
217+
* comparison operators (<code><</code>, <code><=</code>,
218+
* <code>==</code>, <code>>=</code>, and <code>></code>) and the
219+
* method <code>between?</code>.
220220
*
221221
* class SizeMatters
222222
* include Comparable

cont.c

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
11351135
* Continuation objects are generated by Kernel#callcc,
11361136
* after having +require+d <i>continuation</i>. They hold
11371137
* a return address and execution context, allowing a nonlocal return
1138-
* to the end of the <code>callcc</code> block from anywhere within a
1138+
* to the end of the #callcc block from anywhere within a
11391139
* program. Continuations are somewhat analogous to a structured
11401140
* version of C's <code>setjmp/longjmp</code> (although they contain
11411141
* more state, so you might consider them closer to threads).
@@ -1320,11 +1320,10 @@ rollback_ensure_stack(VALUE self,rb_ensure_list_t *current,rb_ensure_entry_t *ta
13201320
* cont.call(args, ...)
13211321
* cont[args, ...]
13221322
*
1323-
* Invokes the continuation. The program continues from the end of the
1324-
* <code>callcc</code> block. If no arguments are given, the original
1325-
* <code>callcc</code> returns <code>nil</code>. If one argument is
1326-
* given, <code>callcc</code> returns it. Otherwise, an array
1327-
* containing <i>args</i> is returned.
1323+
* Invokes the continuation. The program continues from the end of
1324+
* the #callcc block. If no arguments are given, the original #callcc
1325+
* returns +nil+. If one argument is given, #callcc returns
1326+
* it. Otherwise, an array containing <i>args</i> is returned.
13281327
*
13291328
* callcc {|cont| cont.call } #=> nil
13301329
* callcc {|cont| cont.call 1 } #=> 1
@@ -1376,10 +1375,10 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
13761375
* manpage to configure the size of the fiber stack(s).
13771376
*
13781377
* When a fiber is created it will not run automatically. Rather it must
1379-
* be explicitly asked to run using the <code>Fiber#resume</code> method.
1378+
* be explicitly asked to run using the Fiber#resume method.
13801379
* The code running inside the fiber can give up control by calling
1381-
* <code>Fiber.yield</code> in which case it yields control back to caller
1382-
* (the caller of the <code>Fiber#resume</code>).
1380+
* Fiber.yield in which case it yields control back to caller (the
1381+
* caller of the Fiber#resume).
13831382
*
13841383
* Upon yielding or termination the Fiber returns the value of the last
13851384
* executed expression
@@ -1401,10 +1400,10 @@ rb_cont_call(int argc, VALUE *argv, VALUE contval)
14011400
* 2
14021401
* FiberError: dead fiber called
14031402
*
1404-
* The <code>Fiber#resume</code> method accepts an arbitrary number of
1405-
* parameters, if it is the first call to <code>resume</code> then they
1406-
* will be passed as block arguments. Otherwise they will be the return
1407-
* value of the call to <code>Fiber.yield</code>
1403+
* The Fiber#resume method accepts an arbitrary number of parameters,
1404+
* if it is the first call to #resume then they will be passed as
1405+
* block arguments. Otherwise they will be the return value of the
1406+
* call to Fiber.yield
14081407
*
14091408
* Example:
14101409
*
@@ -1946,16 +1945,16 @@ rb_fiber_alive_p(VALUE fibval)
19461945
* call-seq:
19471946
* fiber.resume(args, ...) -> obj
19481947
*
1949-
* Resumes the fiber from the point at which the last <code>Fiber.yield</code>
1950-
* was called, or starts running it if it is the first call to
1951-
* <code>resume</code>. Arguments passed to resume will be the value of
1952-
* the <code>Fiber.yield</code> expression or will be passed as block
1953-
* parameters to the fiber's block if this is the first <code>resume</code>.
1948+
* Resumes the fiber from the point at which the last Fiber.yield was
1949+
* called, or starts running it if it is the first call to
1950+
* #resume. Arguments passed to resume will be the value of the
1951+
* Fiber.yield expression or will be passed as block parameters to
1952+
* the fiber's block if this is the first #resume.
19541953
*
19551954
* Alternatively, when resume is called it evaluates to the arguments passed
1956-
* to the next <code>Fiber.yield</code> statement inside the fiber's block
1955+
* to the next Fiber.yield statement inside the fiber's block
19571956
* or to the block value if it runs to completion without any
1958-
* <code>Fiber.yield</code>
1957+
* Fiber.yield
19591958
*/
19601959
static VALUE
19611960
rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib)
@@ -1970,7 +1969,7 @@ rb_fiber_m_resume(int argc, VALUE *argv, VALUE fib)
19701969
* fiber.raise(exception [, string [, array]]) -> obj
19711970
*
19721971
* Raises an exception in the fiber at the point at which the last
1973-
* <code>Fiber.yield</code> was called, or at the start if neither +resume+
1972+
* Fiber.yield was called, or at the start if neither +resume+
19741973
* nor +raise+ were called before.
19751974
*
19761975
* With no arguments, raises a +RuntimeError+. With a single +String+
@@ -1996,7 +1995,7 @@ rb_fiber_raise(int argc, VALUE *argv, VALUE fib)
19961995
* Transfer control to another fiber, resuming it from where it last
19971996
* stopped or starting it if it was not resumed before. The calling
19981997
* fiber will be suspended much like in a call to
1999-
* <code>Fiber.yield</code>. You need to <code>require 'fiber'</code>
1998+
* Fiber.yield. You need to <code>require 'fiber'</code>
20001999
* before using this method.
20012000
*
20022001
* The fiber which receives the transfer call is treats it much like
@@ -2048,9 +2047,9 @@ rb_fiber_m_transfer(int argc, VALUE *argv, VALUE fibval)
20482047
*
20492048
* Yields control back to the context that resumed the fiber, passing
20502049
* along any arguments that were passed to it. The fiber will resume
2051-
* processing at this point when <code>resume</code> is called next.
2052-
* Any arguments passed to the next <code>resume</code> will be the
2053-
* value that this <code>Fiber.yield</code> expression evaluates to.
2050+
* processing at this point when #resume is called next.
2051+
* Any arguments passed to the next #resume will be the value that
2052+
* this Fiber.yield expression evaluates to.
20542053
*/
20552054
static VALUE
20562055
rb_fiber_s_yield(int argc, VALUE *argv, VALUE klass)

dir.c

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,10 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
592592
* The optional <i>encoding</i> keyword argument specifies the encoding of the directory.
593593
* If not specified, the filesystem encoding is used.
594594
*
595-
* With no block, <code>open</code> is a synonym for
596-
* <code>Dir::new</code>. If a block is present, it is passed
597-
* <i>aDir</i> as a parameter. The directory is closed at the end of
598-
* the block, and <code>Dir::open</code> returns the value of the
599-
* block.
595+
* With no block, <code>open</code> is a synonym for Dir::new. If a
596+
* block is present, it is passed <i>aDir</i> as a parameter. The
597+
* directory is closed at the end of the block, and Dir::open returns
598+
* the value of the block.
600599
*/
601600
static VALUE
602601
dir_s_open(int argc, VALUE *argv, VALUE klass)
@@ -870,8 +869,7 @@ dir_each_entry(VALUE dir, VALUE (*each)(VALUE, VALUE), VALUE arg, int children_o
870869
* dir.pos -> integer
871870
* dir.tell -> integer
872871
*
873-
* Returns the current position in <em>dir</em>. See also
874-
* <code>Dir#seek</code>.
872+
* Returns the current position in <em>dir</em>. See also Dir#seek.
875873
*
876874
* d = Dir.new("testdir")
877875
* d.tell #=> 0
@@ -898,7 +896,7 @@ dir_tell(VALUE dir)
898896
* dir.seek( integer ) -> dir
899897
*
900898
* Seeks to a particular location in <em>dir</em>. <i>integer</i>
901-
* must be a value returned by <code>Dir#tell</code>.
899+
* must be a value returned by Dir#tell.
902900
*
903901
* d = Dir.new("testdir") #=> #<Dir:0x401b3c40>
904902
* d.read #=> "."
@@ -926,8 +924,7 @@ dir_seek(VALUE dir, VALUE pos)
926924
* call-seq:
927925
* dir.pos = integer -> integer
928926
*
929-
* Synonym for <code>Dir#seek</code>, but returns the position
930-
* parameter.
927+
* Synonym for Dir#seek, but returns the position parameter.
931928
*
932929
* d = Dir.new("testdir") #=> #<Dir:0x401b3c40>
933930
* d.read #=> "."
@@ -1044,8 +1041,8 @@ chdir_restore(struct chdir_data *args)
10441041
* Changes the current working directory of the process to the given
10451042
* string. When called without an argument, changes the directory to
10461043
* the value of the environment variable <code>HOME</code>, or
1047-
* <code>LOGDIR</code>. <code>SystemCallError</code> (probably
1048-
* <code>Errno::ENOENT</code>) if the target directory does not exist.
1044+
* <code>LOGDIR</code>. SystemCallError (probably Errno::ENOENT) if
1045+
* the target directory does not exist.
10491046
*
10501047
* If a block is given, it is passed the name of the new current
10511048
* directory, and the block is executed with that as the current
@@ -1242,11 +1239,10 @@ nogvl_mkdir(void *ptr)
12421239
*
12431240
* Makes a new directory named by <i>string</i>, with permissions
12441241
* specified by the optional parameter <i>anInteger</i>. The
1245-
* permissions may be modified by the value of
1246-
* <code>File::umask</code>, and are ignored on NT. Raises a
1247-
* <code>SystemCallError</code> if the directory cannot be created. See
1248-
* also the discussion of permissions in the class documentation for
1249-
* <code>File</code>.
1242+
* permissions may be modified by the value of File::umask, and are
1243+
* ignored on NT. Raises a SystemCallError if the directory cannot be
1244+
* created. See also the discussion of permissions in the class
1245+
* documentation for File.
12501246
*
12511247
* Dir.mkdir(File.join(Dir.home, ".foo"), 0700) #=> 0
12521248
*
@@ -1288,8 +1284,8 @@ nogvl_rmdir(void *ptr)
12881284
* Dir.rmdir( string ) -> 0
12891285
* Dir.unlink( string ) -> 0
12901286
*
1291-
* Deletes the named directory. Raises a subclass of
1292-
* <code>SystemCallError</code> if the directory isn't empty.
1287+
* Deletes the named directory. Raises a subclass of SystemCallError
1288+
* if the directory isn't empty.
12931289
*/
12941290
static VALUE
12951291
dir_s_rmdir(VALUE obj, VALUE dir)
@@ -2974,8 +2970,8 @@ dir_collect(VALUE dir)
29742970
* Dir.entries( dirname, encoding: enc ) -> array
29752971
*
29762972
* Returns an array containing all of the filenames in the given
2977-
* directory. Will raise a <code>SystemCallError</code> if the named
2978-
* directory doesn't exist.
2973+
* directory. Will raise a SystemCallError if the named directory
2974+
* doesn't exist.
29792975
*
29802976
* The optional <i>encoding</i> keyword argument specifies the encoding of the
29812977
* directory. If not specified, the filesystem encoding is used.
@@ -3082,8 +3078,8 @@ dir_collect_children(VALUE dir)
30823078
* Dir.children( dirname, encoding: enc ) -> array
30833079
*
30843080
* Returns an array containing all of the filenames except for "."
3085-
* and ".." in the given directory. Will raise a
3086-
* <code>SystemCallError</code> if the named directory doesn't exist.
3081+
* and ".." in the given directory. Will raise a SystemCallError if
3082+
* the named directory doesn't exist.
30873083
*
30883084
* The optional <i>encoding</i> keyword argument specifies the encoding of the
30893085
* directory. If not specified, the filesystem encoding is used.
@@ -3390,10 +3386,9 @@ rb_dir_s_empty_p(VALUE obj, VALUE dirname)
33903386
}
33913387

33923388
/*
3393-
* Objects of class <code>Dir</code> are directory streams representing
3394-
* directories in the underlying file system. They provide a variety of
3395-
* ways to list directories and their contents. See also
3396-
* <code>File</code>.
3389+
* Objects of class Dir are directory streams representing
3390+
* directories in the underlying file system. They provide a variety
3391+
* of ways to list directories and their contents. See also File.
33973392
*
33983393
* The directory used in these examples contains the two regular files
33993394
* (<code>config.h</code> and <code>main.rb</code>), the parent

encoding.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,11 +1756,11 @@ rb_enc_aliases(VALUE klass)
17561756
* "some string".encode "ISO-8859-1"
17571757
* #=> "some string"
17581758
*
1759-
* <code>Encoding::ASCII_8BIT</code> is a special encoding that is usually
1760-
* used for a byte string, not a character string. But as the name insists,
1761-
* its characters in the range of ASCII are considered as ASCII characters.
1762-
* This is useful when you use ASCII-8BIT characters with other ASCII
1763-
* compatible characters.
1759+
* Encoding::ASCII_8BIT is a special encoding that is usually used for
1760+
* a byte string, not a character string. But as the name insists, its
1761+
* characters in the range of ASCII are considered as ASCII
1762+
* characters. This is useful when you use ASCII-8BIT characters with
1763+
* other ASCII compatible characters.
17641764
*
17651765
* == Changing an encoding
17661766
*
@@ -1798,11 +1798,12 @@ rb_enc_aliases(VALUE klass)
17981798
* All Ruby script code has an associated Encoding which any String literal
17991799
* created in the source code will be associated to.
18001800
*
1801-
* The default script encoding is <code>Encoding::UTF-8</code> after v2.0, but it can
1802-
* be changed by a magic comment on the first line of the source code file (or
1803-
* second line, if there is a shebang line on the first). The comment must
1804-
* contain the word <code>coding</code> or <code>encoding</code>, followed
1805-
* by a colon, space and the Encoding name or alias:
1801+
* The default script encoding is Encoding::UTF_8 after v2.0, but it
1802+
* can be changed by a magic comment on the first line of the source
1803+
* code file (or second line, if there is a shebang line on the
1804+
* first). The comment must contain the word <code>coding</code> or
1805+
* <code>encoding</code>, followed by a colon, space and the Encoding
1806+
* name or alias:
18061807
*
18071808
* # encoding: UTF-8
18081809
*

0 commit comments

Comments
 (0)