ImageVerifierCode 换一换
格式:DOCX , 页数:18 ,大小:368.78KB ,
资源ID:18595707      下载积分:12 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/18595707.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(RDOC说明文档Word文档格式.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

RDOC说明文档Word文档格式.docx

1、ofanimal4. +dog+alsopet5. =levalone6. =two7. andsoon8. -9. howaboutthis10. 11. deffoo(name)12. namename13. end14. 15. 16. Extracttheagecalculate17. date-of-birth.18. #-19. FIXME:failsifbirthdayfalls20. February29th21. #+22. TheDOBisreturnedasTimeobject.23. 24. get_dob(person)25. 26. 27. end效果class D

2、emoPublic Instance Methodsfoo(name) 测试cata kind of animaldogalso a petleval one leval twoand so onhow about this get_dob(person)Extract the age and calculate the date-of-birth. The DOB is returned as aTime object.通常使用rdoc命令来为ruby程序生成文档eg:rdoc test.rb如果要对整个项目的rb文件生成文档只需在rdoc命令后不带文件名rdoc如果有类和方法不想生成doc

3、def no_doc #:nodoc:end或class NoDocClass #:all部分注释不想生成doc#-#该行不会生成doc#+#该行会生成docrdoc命令:-all:rdoc默认只将共有方法生成doc,使用-all会将所有方法生成doc-fmt 用指定格式生成文档-help:-inline-source:将代码显示在文档中-main设置主索引页面的名字-one-file:将rdoc所有文档内容放在一个文件中-op设置输出目录的目录名RDOC - Ruby Documentation SystemThis package contains Rdoc and SimpleMarku

4、p. Rdoc is an application that produces documentation for one or more Ruby source files. We work similarly to JavaDoc, parsing the source, and extracting the definition for classes, modules, and methods (along with includes and requires). We associate with these optional documentation contained in t

5、he immediately preceding comment block, and then render the result using a pluggable output formatter. (Currently, HTML is the only supported format. Markup is a library that converts plain text into various output formats. The Markup library is used to interpret the comment blocks that Rdoc uses to

6、 document methods, classes, and so on.InstallationThis distribution contains two packages, rdoc itself and a text markup library, markup. You can install them both using the single command % ruby install.rbin this directory. If you just want to install , change to the markup directory and run the in

7、stall.rb script there.Roadmap If you want to use Rdoc to create documentation for your Ruby source files, read on. If you want to include extensions written in C, seerdoc/parsers/parse_c.rb. For information on the various markups available in comment blocks, seemarkup/simple_markup.rb. If you want t

8、o drive Rdoc programatically, seeRDoc:RDoc. If you want to use the library to format text blocks into HTML, have a look atSM:SimpleMarkup. If you want to try writing your own HTML output template, seePage.SummaryOnce installed, you can create documentation using the rdoc command (the command is rdoc

9、.rb under Windows) % rdoc options names.Type rdoc -help for an up-to-date option summary.A typical use might be to generate documentation for a package of Ruby source (such as rdoc itself). % rdocThis command generates documentation for all the Ruby and C source files in and below the current direct

10、ory. These will be stored in a documentation tree starting in the subdirectory doc.You can make this slightly more useful for your readers by having the index page contain the documentation for the primary file. In our case, we could type % rdoc -main rdoc/rdoc.rbYoull find information on the variou

11、s formatting tricks you can use in comment blocks in the documentation this generates.RDocuses file extensions to determine how to process each file. File names ending.rb.rbware assumed to be Ruby source. Files ending.care parsed as C files. All other files are assumed to contain just SimpleMarkup-s

12、tyle markup (with or without leading # comment markers). If directory names are passed toRDoc, they are scanned recursively for C and Ruby source files only.Credits The Ruby parser in rdoc/parse.rb is based heavily on the outstanding work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the R

13、uby parser for irb and the rtags package. Code to diagram classes and modules was written by Sergey A Yanovitsky (Jah) of Enticla. Charset patch from MoonWolf. Rich Kilmer wrote the kilmer.rb output template. Dan Brickley led the design of the RDF format.Licenseis Copyright (c) 2001-2003 Dave Thomas

14、, The Pragmatic Programmers. It is free software, and may be redistributed under the terms specified in theREADMEfile of the Ruby distribution.SupportThe Rdoc homepage is. There youll find links for downloading the Rdoc package, and instructions on how to get the still-quivering sources from CVS. Im

15、 also using Sourceforge to track bugs and manage feature requests. If you submit patches, it would help if they were inline (not attachments) and generated using diff -u. I dont have access to a wide variety of browsers, so reports that output looks funny under Browser XYZ arent too helpful: far bet

16、ter are suggested changes to the generated HTML that fix the problem.For other information, feel free to ask on the ruby-talk mailing list (which is mirrored to comp.lang.ruby) or contactdave.Usageis invoked from the command line using: % rdoc name.Files are parsed, and the information they contain

17、collected, before any output is produced. This allows cross references between all files to be resolved. If a name is a directory, it is traversed. If no names are specified, all Ruby files in the current directory (and subdirectories) are processed.Options are:-allinclude protected and private meth

18、ods in the output (by default only public methods are included)-mainnameset the class, module, or file to appear on the index page-excludepatternexclude files and directories matching this pattern from processing-quietdo not display progress messages-one-fileplace all the output into a single file-o

19、pdirset the output directory todir(the default is the directory doc)-opnameset the output name (has no effect for HTML).-charsetcharsetSet the character set for the generated HTML.-fmtfmtgenerate output in a particular format.-includedir,.specify one or more directories to be searched when satifying

20、 given. The directory containing the file currently being processed is always searched.-inline-sourceBy default, the source code of methods is shown in a popup. With this option, its displayed inline.-show-hashA name of the form name in a comment is a possible hyperlink to an instance method name. W

21、hen displayed, the is removed unless this option is specified-templatespecify an alternate template to use when generating output (the default is standard). This template should be in a directory accessible via $: as rdoc/generators/xxxx_template, where xxxx depends on the output formatter.-diagrami

22、nclude diagrams showing modules and classes. This is currently an experimental feature, and may not be supported by all output templates. You need dot V1.8.6 or later to use the -diagram option correctly (ExampleA typical small Ruby program commented usingmight be as follows. You can see the formatt

23、ed result in EXAMPLE.rb andAnagram. # The program takes an initial word or phrase from # the command line (or in the absence of a # parameter from the first line of standard # input). In then reads successive words or # phrases from standard input and reports whether # they are angrams of the first

24、word. # # Author: Dave Thomas (mailto:davex.y) # Copyright: Copyright (c) 2002 The Pragmatic Programmers, LLC # License: Distributes under the same terms as Ruby # This class holds the letters in the original # word or phrase. The is_anagram? method allows us # to test if subsequent words or phrases

25、 are # anagrams of the original. class Anagram # Remember the letters in the initial word def initialize(text) initial_letters = letters_of(text) end # Test to see if a new word contains the same # letters as the original def is_anagram?(text) initial_letters = letters_of(text) # Determine the lette

26、rs in a word or phrase # * all letters are converted to lower case # * anything not a letter is stripped out # * the letters are converted into an array # * the array is sorted # * the letters are joined back into a string def letters_of(text) text.downcase.delete(a-z).split().sort.join tester = Ana

27、gram.new(ARGV.shift | gets) ARGF.each do |text| puts Anagram! if tester.is_anagram? textMarkupComment blocks can be written fairly naturally.Paragraphs are lines that share the left margin. Text indented past this margin are formatted verbatim.1. Lists are typed as indented paragraphs with:o a * or

28、- (for bullet lists)o a digit followed by a period for numbered listsFor example, the input that produced the above paragraph looked like 1. Lists are typed as indented paragraphs with: * a * a digit followed by a period for numbered lists2. Labeled lists (sometimes called description lists) are typ

29、ed using square brackets for the label.3. cat small domestic animal4. +cat+ command to copy standard input5. Labeled lists may also be produced by putting a double colon after the label. This sets the result in tabular form, so the descriptions all line up. This was used to create the author block at the bottom of

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1