欢迎来到冰豆网! | 帮助中心 分享价值,成长自我!
冰豆网
全部分类
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • 党团工作>
  • ImageVerifierCode 换一换
    首页 冰豆网 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

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

    • 资源ID:18595707       资源大小:368.78KB        全文页数:18页
    • 资源格式: DOCX        下载积分:12金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要12金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    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


    注意事项

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

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2022 冰点文档网站版权所有

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

    收起
    展开