Getting Started

1.Interactive Ruby—is the tool of choicefor executing Ruby interactively. irb is a Ruby shell, complete withcommand-line history, line-editing capabilities, and job control. Exit an irbsession by typing exit or by using the end-of-file character on your operatingsystem (normally Ctrl+D or Ctrl+Z).

2.?On Unix systems, you can use the“shebang” notation as the first line of the program file: #!/usr/bin/ruby

3.?A shebang (also called a hashbang) isthe character sequence consisting of the characters number sign and exclamationpoint (#!), when it occurs as the first two characters on the first line of atext file. In this case, the program loader in Unix-like operating systemsparses the rest of the first line as an interpreter directive and invokes theprogram specified after the character sequence with any command line optionsspecified as parameters. The name of the file being executed is passed as thefinal argument.

4.?If a source file is documented usingRDoc, its documentation can be extracted and converted into HTML and riformats.

5.?To find the documentation for a class,type riClassName. To get a list of classes with ri documentation, type riwith no arguments.

6.Once you find a set of options youlike, you can set them into the RI environment variable. Using our shell, thiswould be done using the following:

$ export RI=”–format ansi –width 70″

而做人的能力则会给你一百种机会。

Getting Started

相关文章:

你感兴趣的文章:

标签云: