rdoc

How to generate rdoc-style collapsable code sections?

自作多情 提交于 2019-12-07 03:25:12
问题 I am creating internal documentation for a C++ project using Doxygen. I am having Doxygen include the source for methods, etc., but this makes the page kind of hard to scan. I'd like it to behave like rdoc and hide the source in a block that is collapsed by default. I thought that HTML_DYNAMIC_SECTIONS might let me do this, but alas, the changelog says that option only affects diagrams and graphs. Maybe I could do it by editing the LAYOUT_FILE ? Anyhow, smart people, how can I coerce Doxygen

Ruby regular expression method !~

跟風遠走 提交于 2019-12-06 10:32:52
问题 I don't remember where I learned the !~ method of the String class. However I know it compares a string to a regex and check whether the string not match the regex. See my below example. C:\>irb irb(main):001:0> "abba" =~ /(\w)(\w)\2\1/i => 0 irb(main):002:0> "xxxx" =~ /(\w)(\w)\2\1/i => 0 irb(main):003:0> "asdf" =~ /(\w)(\w)\2\1/i => nil irb(main):004:0> "asdf" !~ /(\w)(\w)\2\1/i => true irb(main):005:0> "asdf" !~ /asdf/i => false irb(main):006:0> I want to find more information of the

Can I get my README.textile into my RDoc with proper formatting?

笑着哭i 提交于 2019-12-06 03:02:39
问题 I like to use Textile or Markdown to write readme files for my projects, but when I generate the RDoc the readme file gets interpreted as RDoc and looks really horrible. Is there a way to make RDoc run the file through RedCloth or BlueCloth instead of its own formatter? Can it be configured to autodetect the formatting from the file suffix? (e.g. README.textile gets run through RedCloth, but README.mdown gets run through BlueCloth) 回答1: Using YARD instead of RDoc directly will let you include

Displaying inherited methods in rdoc

橙三吉。 提交于 2019-12-05 23:52:57
I have a program written in Ruby that uses multiple levels of inheritance. All of the parent classes have implemented methods that an object of a child class would use, but when I generate an rdoc for my program, the rdoc page for a child class only shows the methods for that specific class and no methods from the parent class. Does anyone know how to display inherited class methods in rdoc? I have looked through rdoc documentation and some websites and haven't been able to find an answer on whether this is possible. This is a good question, but I am not aware of any solution. In fact, when I

What's the rationale/history for the # convention of identifying methods in Ruby?

旧巷老猫 提交于 2019-12-05 19:56:39
问题 For example, I've always seen methods referred to as String#split , but never String.split , which seems slightly more logical. Or maybe even String::split , because you could consider #split to be in the namespace of String . I've even seen the method alone, when the class is assumed/implied ( #split ). I understand that this is the way methods are identified in ri. Which came first? Is this to differentiate, for example, methods from fields? I've also heard that this helps differentiates

How to generate rdoc-style collapsable code sections?

别说谁变了你拦得住时间么 提交于 2019-12-05 07:54:36
I am creating internal documentation for a C++ project using Doxygen. I am having Doxygen include the source for methods, etc., but this makes the page kind of hard to scan. I'd like it to behave like rdoc and hide the source in a block that is collapsed by default. I thought that HTML_DYNAMIC_SECTIONS might let me do this, but alas, the changelog says that option only affects diagrams and graphs. Maybe I could do it by editing the LAYOUT_FILE ? Anyhow, smart people, how can I coerce Doxygen to generate collapsable code sections? ax. if includ[ing] the source for methods, etc, [...] makes the

Ruby regular expression method !~

妖精的绣舞 提交于 2019-12-04 17:55:17
I don't remember where I learned the !~ method of the String class. However I know it compares a string to a regex and check whether the string not match the regex. See my below example. C:\>irb irb(main):001:0> "abba" =~ /(\w)(\w)\2\1/i => 0 irb(main):002:0> "xxxx" =~ /(\w)(\w)\2\1/i => 0 irb(main):003:0> "asdf" =~ /(\w)(\w)\2\1/i => nil irb(main):004:0> "asdf" !~ /(\w)(\w)\2\1/i => true irb(main):005:0> "asdf" !~ /asdf/i => false irb(main):006:0> I want to find more information of the method but I can't find it in the rdoc of both String and Regexp . Anyone can give some help? Thanks. Since

error installing RDoc documentation: incompatible encoding regexp match

假如想象 提交于 2019-12-04 11:48:25
问题 Over the last week, on a few gem install or gem update operations, I've received an error similar to these: ERROR: While generating documentation for sinatra-1.3.1 ... MESSAGE: error generating C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/doc/sinatra-1.3.1/rdoc/README_de_rdoc.html: incompatible encoding regexp match (UTF-8 regexp with IBM437 string) (Encoding::CompatibilityError) similarly: ERROR: While generating documentation for rest-client-1.6.7 ... MESSAGE: error generating C:

What's the rationale/history for the # convention of identifying methods in Ruby?

别等时光非礼了梦想. 提交于 2019-12-04 02:58:02
For example, I've always seen methods referred to as String#split , but never String.split , which seems slightly more logical. Or maybe even String::split , because you could consider #split to be in the namespace of String . I've even seen the method alone, when the class is assumed/implied ( #split ). I understand that this is the way methods are identified in ri. Which came first? Is this to differentiate, for example, methods from fields? I've also heard that this helps differentiates instance methods from class methods. But where did this start? The difference indicates how you access

creating Rdoc for a rails app

隐身守侯 提交于 2019-12-03 13:09:00
I would like to generate a documentation to my rails (2.3.8) project. When I tried rake doc:rails rake doc:rerails It creates documentation for all the classes including standard ruby classes and all the ruby files in vendor directory (plugins etc..) How can I create rdoc documentation only for ruby classes, files in following directories app folder (all the models, controllers and views) config folder lib folder I added this to my Rakefile; RDoc::Task.new :rdoc do |rdoc| rdoc.main = "README.rdoc" rdoc.rdoc_files.include("README.rdoc", "doc/*.rdoc", "app/**/*.rb", "lib/*.rb", "config/**/*.rb")