~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to man/ruby.1

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
.Pp
38
38
If you want a language for easy object-oriented programming, or you
39
39
don't like the Perl ugliness, or you do like the concept of LISP, but
40
 
don't like too much parentheses, Ruby may be the language of your
 
40
don't like too many parentheses, Ruby might be your language of
41
41
choice.
42
42
.Sh FEATURES
43
43
Ruby's features are as follows:
53
53
.Pp
54
54
.It Sy "No declaration needed"
55
55
You can use variables in your Ruby programs without any declarations.
56
 
Variable names denote their scope, local, global, instance, etc.
 
56
Variable names denote their scope - global, class, instance, or local.
57
57
.Pp
58
58
.It Sy "Simple syntax"
59
59
Ruby has a simple syntax influenced slightly from Eiffel.
64
64
built into the interpreter.
65
65
.Pp
66
66
.It Sy "Everything is an object"
67
 
Ruby is the purely object-oriented language, and was so since its
 
67
Ruby is a purely object-oriented language, and was so since its
68
68
creation.  Even such basic data as integers are seen as objects.
69
69
.Pp
70
70
.It Sy "Class, inheritance, and methods"
71
 
Of course, as an object-oriented language, Ruby has such basic
 
71
Being an object-oriented language, Ruby naturally has basic
72
72
features like classes, inheritance, and methods.
73
73
.Pp
74
74
.It Sy "Singleton methods"
81
81
.It Sy "Mix-in by modules"
82
82
Ruby intentionally does not have the multiple inheritance as it is a
83
83
source of confusion.  Instead, Ruby has the ability to share
84
 
implementations across the inheritance tree.  This is often called
 
84
implementations across the inheritance tree.  This is often called a
85
85
.Sq Mix-in .
86
86
.Pp
87
87
.It Sy "Iterators"
90
90
.It Sy "Closures"
91
91
In Ruby, you can objectify the procedure.
92
92
.Pp
93
 
.It Sy "Text processing and regular expression"
 
93
.It Sy "Text processing and regular expressions"
94
94
Ruby has a bunch of text processing features like in Perl.
95
95
.Pp
96
96
.It Sy "M17N, character set independent"
102
102
With built-in bignums, you can for example calculate factorial(400).
103
103
.Pp
104
104
.It Sy "Reflection and domain specific languages"
105
 
Class is also an instance of Class class. Definition of classes and methods
106
 
is just an expression as 1+1 is. So your programs can even write and modify programs.
 
105
Class is also an instance of the Class class. Definition of classes and methods
 
106
is an expression just as 1+1 is. So your programs can even write and modify programs.
107
107
Thus you can write your application in your own programming language on top of Ruby.
108
108
.Pp
109
109
.It Sy "Exception handling"
161
161
.It Fl -encoding Ar external Ns Op : Ns Ar internal
162
162
Specifies the default value(s) for external encodings and internal encoding. Values should be separated with colon (:).
163
163
.Pp
164
 
You can ommit the one for internal encodings, then the value
 
164
You can omit the one for internal encodings, then the value
165
165
.Pf ( Li "Encoding.default_internal" ) will be nil.
166
166
.Pp
167
167
.It Fl F Ar pattern
209
209
Turns on taint checks at the specified level (default 1).
210
210
.Pp
211
211
.It Fl U
212
 
Sets the defalut value for internal encodings
 
212
Sets the default value for internal encodings
213
213
.Pf ( Li "Encoding.default_internal" ) to UTF-8.
214
214
.Pp
215
215
.It Fl W Ns Op Ar level=2
259
259
.Pp
260
260
.It Fl e Ar command
261
261
Specifies script from command-line while telling Ruby not to search
262
 
the rest of arguments for a script file name.
 
262
the rest of the arguments for a script file name.
263
263
.Pp
264
264
.It Fl h
265
265
.It Fl -help
367
367
.Li EOF ,
368
368
.Li "^D" ( Li "control-D" ) ,
369
369
.Li "^Z" ( Li "control-Z" ) ,
370
 
or reserved word
 
370
or the reserved word
371
371
.Li __END__ .
372
372
If the directory name is specified, Ruby will switch to that directory
373
373
before executing script.
413
413
can be one of;
414
414
.Bl -hang -offset indent
415
415
.It Sy insns
416
 
disassembed instructions
 
416
disassembled instructions
417
417
.Pp
418
418
.El
419
419
.Pp
474
474
This variable is obsolete.
475
475
.El
476
476
.Pp
477
 
And Ruby depends on some RubyGems related environment variables unless disabled RubyGems.
 
477
And Ruby depends on some RubyGems related environment variables unless RubyGems is disabled.
478
478
See the help of
479
479
.Xr gem 1
480
480
as bellow.
497
497
.Li Security vulnerabilities should be reported via an email to
498
498
.Aq security@ruby-lang.org Ns
499
499
.Li .
500
 
Reported problems will be published after fixed.
 
500
Reported problems will be published after they've been fixed.
501
501
.Pp
502
502
.Li And you can report other bugs and feature requests via the
503
503
Ruby Issue Tracking System (http://redmine.ruby-lang.org).
504
504
Do not report security vulnerabilities
505
 
via the system because it publishes the vulnerabilities immedately.
 
505
via the system because it publishes the vulnerabilities immediately.
506
506
.El
507
507
.Sh AUTHORS
508
508
Ruby is designed and implemented by