Skip to content

Commit bff9bf2

Browse files
committed
Various small improvements in FAQ
* fix some typos and grammar * consistently use "---" as dash * improve some Markdown
1 parent 27daea3 commit bff9bf2

File tree

11 files changed

+202
-199
lines changed

11 files changed

+202
-199
lines changed

en/documentation/faq/1/index.md

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ Ruby features:
5555

5656
* Simple syntax,
5757
* Basic OO features (classes, methods, objects, and so on),
58-
* Special OO features (Mix-ins, singleton methods, renaming, ...),
58+
* Special OO features (mixins, singleton methods, renaming, ...),
5959
* Operator overloading,
6060
* Exception handling,
6161
* Iterators and closures,
6262
* Garbage collection,
6363
* Dynamic loading (depending on the architecture),
64-
* High transportability (runs on various Unices, Windows, DOS, OSX, OS/2,
65-
Amiga, and so on)
64+
* High transportability (runs on various Unices, Windows, DOS, OS X, OS/2,
65+
Amiga, and so on).
6666

6767
### Show me some Ruby code!
6868

@@ -100,7 +100,7 @@ zoe: 7
100100
~~~
101101

102102
The code uses regular expressions to parse successive lines from the input
103-
file, creating a new `Person` object for each match and pushing it on to the
103+
file, creating a new `Person` object for each match and pushing it onto the
104104
end of the array `people`.
105105

106106
~~~
@@ -147,24 +147,24 @@ programming language newer (and hopefully better) than Perl.
147147

148148
### What is the history of Ruby?
149149

150-
The following a summary of a posting made by Matz in [ruby-talk:00382] on
151-
June 4, 1999. (The birthday of Ruby is corrected in [ruby-list:15977]).
150+
The following is a summary of a posting made by Matz in [ruby-talk:00382] on
151+
June 4, 1999. (The birthday of Ruby has been corrected in [ruby-list:15977].)
152152

153-
> Well, Ruby was born on February 24 1993. I was talking with my colleague
153+
> Well, Ruby was born on February 24, 1993. I was talking with my colleague
154154
> about the possibility of an object-oriented scripting language. I knew Perl
155-
> (Perl4, not Perl5), but I didn't like it really, because it had smell of toy
156-
> language (it still has). The object-oriented scripting language seemed very
157-
> promising.
155+
> (Perl4, not Perl5), but I didn't like it really, because it had the smell of
156+
> a toy language (it still has). The object-oriented scripting language seemed
157+
> very promising.
158158
159159
> I knew Python then. But I didn't like it, because I didn't think it was a
160-
> true object-oriented language---OO features appeared to be add-on to the
160+
> true object-oriented language---OO features appeared to be an add-on to the
161161
> language. As a language manic and OO fan for 15 years, I really wanted a
162162
> genuine object-oriented, easy-to-use scripting language. I looked for, but
163163
> couldn't find one.
164164
165165
> So, I decided to make it. It took several months to make the interpreter
166-
> run. I put it the features I love to have in my language, such as iterators,
167-
> exception handling, garbage collection.
166+
> run. I put into it the features I love to have in my language, such as
167+
> iterators, exception handling, garbage collection.
168168
169169
> Then, I reorganized the features of Perl into a class library, and
170170
> implemented them. I posted Ruby 0.95 to the Japanese domestic newsgroups
@@ -196,19 +196,17 @@ comp.lang.ruby was established in May, 2000 (thanks to the efforts of
196196
There are five mailing lists now talking about Ruby. The first is in English,
197197
the last four in Japanese:
198198

199-
~~~
200-
ruby-talk: English language discussion of Ruby.
201-
ruby-list: Japanese language discussion of Ruby.
202-
ruby-dev: List for Ruby developers.
203-
ruby-ext: List for people writing extensions for or with Ruby.
204-
ruby-math: Ruby in mathematics.
205-
~~~
199+
* `ruby-talk`: English language discussion of Ruby.
200+
* `ruby-list`: Japanese language discussion of Ruby.
201+
* `ruby-dev`: List for Ruby developers.
202+
* `ruby-ext`: List for people writing extensions for or with Ruby.
203+
* `ruby-math`: Ruby in mathematics.
206204

207205
See [joining the mailing list](http://www.ruby-lang.org/en/ml.html).
208206

209207
You can search the mailing list archives using
210208
[http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml](http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml).
211-
(This is the url for the ruby-talk list: munge as required for the others).
209+
(This is the URL for the ruby-talk list, munge as required for the others).
212210

213211
### How can I thread the mailing list in mutt?
214212

@@ -233,32 +231,32 @@ Originally, or historically, it was called “ruby”.
233231

234232
### Are there any Ruby books?
235233

236-
Programming Ruby: The Pragmatic Programmer's Guide, (the Pickaxe Book) by
237-
David Thomas and Andrew Hunt: ISBN 0-20171-089-7, Addison-Wesley,
238-
October 2000.
234+
* Programming Ruby: The Pragmatic Programmer's Guide,
235+
(the Pickaxe Book) by David Thomas and Andrew Hunt: ISBN 0-20171-089-7,
236+
Addison-Wesley, October 2000.
239237

240-
A Japanese language Ruby reference book by matz, et al and published by ASCII
241-
is available in Japan (ISBN 4-7561-3254-5). An English translation,
242-
“The Ruby Programming Language”, is in the works from Addison-Wesley
243-
(ISBN 020171096X).
238+
* A Japanese language Ruby reference book by matz et al. and published by
239+
ASCII is available in Japan (ISBN 4-7561-3254-5). An English translation,
240+
“The Ruby Programming Language”, is in the works from Addison-Wesley
241+
(ISBN 020171096X).
244242

245-
A Japanese language “Ruby Pocket Reference” is published by O'Reilly Japan
246-
(ISBN 4-87311-023-8). Let O'Reilly in the US know if you'd like to see a
247-
translation.
243+
* A Japanese language “Ruby Pocket Reference” is published by O'Reilly Japan
244+
(ISBN 4-87311-023-8). Let O'Reilly in the US know if you'd like to see a
245+
translation.
248246

249-
In addition, “Mastering Regular Expressions”, by Jeffrey Friedl, (the Hip
250-
Owl Book): ISBN 1-56592-257-3 from O'Reilly & Associates, is a reference work
251-
that covers the art and implementation of regular expressions in various
252-
programming languages. Most of it is highly relevant to Ruby regular
253-
expressions.
247+
* In addition, “Mastering Regular Expressions”, by Jeffrey Friedl,
248+
(the Hip Owl Book): ISBN 1-56592-257-3 from O'Reilly & Associates,
249+
is a reference work that covers the art and implementation of regular
250+
expressions in various programming languages. Most of it is highly
251+
relevant to Ruby regular expressions.
254252

255253
### Which editors provide support for Ruby?
256254

257255
* [Emacs](http://www.gnu.org/software/emacs/emacs.html)
258256
or [XEmacs](http://www.xemacs.org/): `ruby-mode.el` is supplied in the Ruby
259257
distribution. With some versions of XEmacs, you may need to add
260258
`(load "font-lock")` to your `.emacs` file to allow `ruby-mode.el` to detect
261-
the syntax highlighting package you're using.
259+
the syntax highlighting package you are using.
262260
* [Vim](http://www.vim.org/): Vim 5.7 and later have Ruby syntax files as
263261
standard in the runtime package. For prior versions, a syntax file for Ruby
264262
is available at
@@ -279,7 +277,7 @@ expressions.
279277
People commonly annotate Ruby code by showing the results of executing each
280278
statement as a comment attached to that statement. For example, in the
281279
following code, we show that the assignment generates the string "Billy Bob",
282-
and then result of extracting some substrings.
280+
and then the result of extracting some substrings.
283281

284282
~~~
285283
str = "Billy" + " Bob" # => "Billy Bob"
@@ -322,7 +320,7 @@ behind.
322320
If you have a problem, feel free to ask in the mailing list
323321
(see [ruby-talk mailing list](#mailing-lists)).
324322
Generally you'll get timely answers from matz himself, the
325-
author of the language, from other gurus, and from those who've solved
323+
author of the language, from other gurus, and from those who have solved
326324
problems similar to your own.
327325

328326
Please include the output of `ruby -v` along with any problematic

en/documentation/faq/10/index.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,20 @@ header: |
4040
### How can I use Ruby interactively?
4141
{: #irb}
4242

43-
You can try using `irb`. The following is paraphrased from Goto Kentaro
44-
(Gotoken), and originally appeared in ruby-talk:444.
45-
46-
~~~
47-
Get the latest tarball of irb from the contrib directory (ftp://ftp.netlab.co.jp/pub/lang/ruby/contrib/) in the Ruby archive.
48-
Extract the irb directory tree.
49-
Add the location of the irb/ directory to the $RUBYLIB environment variable
50-
Make a symbolic link from $RUBYLIB/irb/irb.rb to a file called irb somewhere in your path.
51-
chmod +x $RUBYLIB/irb/irb.rb
52-
Possibly use rehash to tell your login shell about the new command.
53-
Type irb
54-
~~~
43+
You can try using `irb`. The following is paraphrased from Kentaro Goto
44+
(Gotoken), and originally appeared in [ruby-talk:444].
45+
46+
1. Get the latest tarball of `irb` from the
47+
[contrib directory](ftp://ftp.netlab.co.jp/pub/lang/ruby/contrib/)
48+
in the Ruby archive.
49+
2. Extract the `irb` directory tree.
50+
3. Add the location of the `irb/` directory to the `$RUBYLIB`
51+
environment variable.
52+
4. Make a symbolic link from `$RUBYLIB/irb/irb.rb` to a file called `irb`
53+
somewhere in your path.
54+
5. `chmod +x $RUBYLIB/irb/irb.rb`
55+
6. Possibly use `rehash` to tell your login shell about the new command.
56+
7. Type `irb`.
5557

5658
If the readline extension module works with your interpreter, it makes `irb`
5759
a lot more fun to use.
@@ -81,22 +83,22 @@ few interfaces to learn. In fact, C code used to extend Ruby often ends up
8183
looking surprisingly like Ruby code itself.
8284

8385
First, get the Ruby source distribution and read `README.EXT`. This is a
84-
good document, not only if you're writing an extension library, but also
86+
good document, not only if you are writing an extension library, but also
8587
if you want to understand Ruby more deeply.
8688

8789
Next, have a look at the source of the interpreter itself, and at the various
88-
supplied extensions in the `ext/` directory. You'll also find good examples
90+
supplied extensions in the `ext/` directory. You will also find good examples
8991
under `contrib/` on the Ruby ftp sites.
9092

9193
### Can I use Tcl/Tk interface in Ruby?
9294

9395
There are two interfaces to Tcl/Tk included in the standard distribution.
9496
One is under `ext/tcltk/` and loaded with `require "tcltk"`. The syntax is
95-
very close to that Tcl, which is passed to Tcl interpreter.
97+
very close to that Tcl which is passed on to the Tcl interpreter.
9698
Unfortunately, the description for this library is written in Japanese.
9799

98100
The other is under `ext/tk/` and loaded with `require "tk"`. Its syntax
99-
closer to the style of the Tk interface provided by the Perl and Python
101+
is closer to the style of the Tk interface provided by the Perl and Python
100102
interfaces.
101103

102104
### Tk won't work.
@@ -105,8 +107,8 @@ Your Tk version may be old, try a newer version.
105107

106108
### Can I use gtk+ or xforms interfaces in Ruby?
107109

108-
You'll find ruby-gtk-x.xx.tar.gz and ruby-forms-x.x.tar.gz under `contrib/`
109-
in ftp sites.
110+
You will find `ruby-gtk-x.xx.tar.gz` and `ruby-forms-x.x.tar.gz`
111+
under `contrib/` in ftp sites.
110112

111113
### How can I do date arithmetic?
112114

en/documentation/faq/11/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ header: |
3939

4040
### What does `a ? b : c` mean?
4141

42-
It's the same as saying `if a then b else c` end.
42+
It's the same as saying `if a then b else c end`.
4343

4444
### How can I count the number of lines in a file?
4545

46-
Assuming that the file ends in a linefeed, the following code may give the
46+
Assuming that the file ends in a newline, the following code may give the
4747
fastest result.
4848

4949
~~~
@@ -58,9 +58,9 @@ matched data (`$0`) in the original string. See an example in
5858

5959
### How can I sum the elements in an array?
6060

61-
Rather than solve the specific problem, let's solve the general case. The
62-
first thing we'll do is produce a method that will iterate over an
63-
`Enumerable` object and collect a single result. Smalltalk calls that
61+
Rather than solve the specific problem, let's solve the general case.
62+
The first thing we will do is produce a method that will iterate over
63+
an `Enumerable` object and collect a single result. Smalltalk calls that
6464
method inject, so we will too:
6565

6666
~~~
@@ -76,7 +76,7 @@ module Enumerable
7676
end
7777
~~~
7878

79-
Notice how we've added the method to `Enumerable`. This means that anything
79+
Notice how we have added the method to `Enumerable`. This means that anything
8080
that includes Enumerable can now use `inject`. But how do we use it? It takes
8181
a single argument `n` and a block. For each element in the thing being
8282
enumerated, it calls the block, passing in `n` and the element itself.
@@ -86,7 +86,7 @@ we could write:
8686
~~~
8787
module Enumerable
8888
def sum
89-
inject(0) {|n, i| n + i }
89+
inject(0) {|n, i| n + i }
9090
end
9191
end
9292

en/documentation/faq/2/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ header: |
4141

4242
Python and Ruby are both object oriented languages that provide a smooth
4343
transition from procedural to OO programming styles. Smalltalk, by contrast,
44-
is object only - you can't do anything until you understand objects,
44+
is object only---you can't do anything until you understand objects,
4545
inheritance and the sizable Smalltalk class hierarchy. By providing procedural
4646
training wheels, Python and Ruby “fix” one of the features that may have
4747
kept Smalltalk out of the mainstream. The two languages differ by approaching
@@ -59,7 +59,7 @@ functions, only method calls. In a Ruby method the receiver, also called
5959
a class definition, which is a function in Python, is actually a method call
6060
in Ruby. These ersatz functions become private methods of class Object, the
6161
root of the Ruby class hierarchy. Procedural programming is neatly solved from
62-
the other direction - everything is an object. If the user doesn't grok
62+
the other direction---everything is an object. If the user doesn't grok
6363
objects yet, they can just pretend that `def` is a function definition and
6464
still get useful work done.
6565

@@ -95,7 +95,7 @@ difference in design philosophy between Python and Ruby/Perl.
9595
Ruby is much more complex than Python but its features, for the most part,
9696
hang together well. Ruby is well designed and full of neat ideas that might be
9797
mined for P3K. I'm not sure how many Python programmers will be attracted to
98-
it though - it hasn't won me over (yet). But it is worthy of serious study and
98+
it though---it hasn't won me over (yet). But it is worthy of serious study and
9999
could be a real threat to Perl.
100100

101101
Posted by [John Dell'Aquila](mailto:jbd@alum.mit.edu) in comp.lang.python,

en/documentation/faq/3/index.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ header: |
4040
### What operating systems support Ruby?
4141

4242
Ruby is developed under Linux, and is written in fairly straightforward C.
43-
It runs under UNIX, DOS, Windows 95/98/NT/2000, Mac OSX, BeOS, Amiga,
43+
It runs under UNIX, DOS, Windows 95/98/NT/2000, Mac OS X, BeOS, Amiga,
4444
Acorn Risc OS, and OS/2.
4545

4646
August 2002:
4747

48-
MacOSX 10.2 now comes with ruby installed by default.
49-
(ruby 1.6.7 (2002-03-01) [powerpc-darwin6.0])
48+
Mac OS X 10.2 now comes with Ruby installed by default
49+
(Ruby 1.6.7 (2002-03-01) [powerpc-darwin6.0]).
5050
See http://developer.apple.com/technotes/tn2002/tn2053.html.
5151

52-
H Morita notes:
52+
H. Morita notes:
5353

54-
> There's a MacOS (not X) port of Ruby, by Hisakuni FUJIMOTO at
54+
> There's a Mac OS (not X) port of Ruby, by Hisakuni FUJIMOTO at
5555
> [http://www.imasy.or.jp/~hisa/ruby/macruby.html](http://www.imasy.or.jp/~hisa/ruby/macruby.html).
5656
> However it's based on Ruby 1.1b7, and hasn't been updated since
5757
> December 1999. It's highly experimental. It may crash and sometimes freeze
@@ -65,7 +65,7 @@ However, that link seems broken: can anyone give us something that works?
6565
### Where can I get Ruby sources?
6666

6767
The latest version of Ruby can be downloaded from:
68-
[http://www.ruby-lang.org/en/download.html](http://www.ruby-lang.org/en/download.html)
68+
[http://www.ruby-lang.org/en/download.html](http://www.ruby-lang.org/en/download.html).
6969
Mirror sites are also listed on this page.
7070

7171
Also on this page is a link to a nightly snapshot of the development tree.
@@ -92,7 +92,7 @@ environment. You don't need the `autoconf` command on your box to build Ruby
9292
from a distribution; just use the commands:
9393

9494
~~~
95-
% ./configure [configure options]
95+
% ./configure [configure options]
9696
% make
9797
% make test
9898
% make install
@@ -153,7 +153,7 @@ He recommends installing the GNU equivalent.
153153
### Are precompiled binaries available?
154154

155155
A single download that contains everything you need to run Ruby under various
156-
Windows operating systems. is available from
156+
Windows operating systems is available from
157157
[RubyCentral's One-click Windows installer](http://www.rubycentral.com/downloads/ruby-install.html).
158158
This installation uses cygwin, and includes Tk support.
159159

@@ -178,7 +178,7 @@ available from the same page.
178178
Ruby is written to take advantage of the rich feature set of a Unix
179179
environment. Unfortunately, Windows is missing some of the functions, and
180180
implements others differently. As a result, some kind of mapping layer is
181-
needed to run Ruby (and other Unix-based programs) under windows.
181+
needed to run Ruby (and other Unix-based programs) under Windows.
182182

183183
You may come across different versions of the Ruby executable that use
184184
different wrapper mapping layers.
@@ -189,17 +189,17 @@ It uses the DJ Delorie tools
189189

190190
The rbcw version is a Windows binary of Ruby that requires the cygwin library,
191191
available at [http://www.cygwin.com](http://www.cygwin.com) or from the
192-
Ruby download pages. Cygwin is a both an emulation layer and a set of
192+
Ruby download pages. Cygwin is both an emulation layer and a set of
193193
utilities initially produced by Cygnus Solutions (now part of Redhat).
194-
The Cygwin version of Ruby probably has the fullest set of features under
194+
The cygwin version of Ruby probably has the fullest set of features under
195195
Windows, so most programmers will want to use it.
196196

197197
To use the rbcw version, you will need to install the cygwin .dll separately.
198198
Once you have installed cygwin on your computer, copy `cygwin1.dll` (which
199199
is found in the `bin` subdirectory of the cygwin distribution) to your
200200
`Windows\System32` folder (or somewhere else on your path).
201201

202-
Thanks to Anders Schneiderman for the basis of this description
202+
Thanks to Anders Schneiderman for the basis of this description.
203203

204204
### Why doesn't Tk graphics work under Windows?
205205

0 commit comments

Comments
 (0)