Getting Started_Ruby_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > Ruby > Getting Started

Getting Started

 2011/11/22 9:22:26  leonzhx  http://seanzhou.iteye.com  我要评论(0)
  • 摘要:1.InteractiveRuby—isthetoolofchoiceforexecutingRubyinteractively.irbisaRubyshell,completewithcommand-linehistory,line-editingcapabilities,andjobcontrol.Exitanirbsessionbytypingexitorbyusingtheend-of-filecharacteronyouroperatingsystem
  • 标签:Getting Started

1. Interactive Ruby—is the tool of choice for executing Ruby interactively. irb is a Ruby shell, complete with command-line history, line-editing capabilities, and job control. Exit an irb session by typing exit or by using the end-of-file character on your operating system (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) is the character sequence consisting of the characters number sign and exclamation point (#!), when it occurs as the first two characters on the first line of a text file. In this case, the program loader in Unix-like operating systems parses the rest of the first line as an interpreter directive and invokes the program specified after the character sequence with any command line options specified as parameters. The name of the file being executed is passed as the final argument.

?

4.? If a source file is documented using RDoc, its documentation can be extracted and converted into HTML and ri formats.

?

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

?

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

$ export RI="--format ansi --width 70"

发表评论
用户名: 匿名