免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2153 | 回复: 1
打印 上一主题 下一主题

Getting Started [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-11-18 11:26 |只看该作者 |倒序浏览
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"

论坛徽章:
0
2 [报告]
发表于 2011-11-18 11:39 |只看该作者
What do you mean for posting
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP