Comments (7)
I think the best way to accomplish this would be through a parser for spec files. https://github.com/rdoc/rdoc-rake is a parser for rake files that you could use as an example.
Instead of creating new classes to contain spec data the parser would look up the corresponding class and add the "Spec:" section to the existing comment.
This may require some changes to rdoc to ensure that the spec parser runs after other directories are parsed, but I would be happy to assist with those.
from rdoc.
Hey thanks, it was the bit around ensuring rdoc runs the spec parsing after the other directories were parsed where I thought I'd need help since I think rdoc tends to replace comments instead of append to them (?).
from rdoc.
The ruby parser overwrites method comments but not class comments. Usually classes and modules are extended through reopening but defining a method twice for the same class is not a good idea. Try running rdoc on this example:
# class comment 1
class C
# method comment 1
def m
end
end
# class comment 2
class C
# method comment 2
def m
end
end
If you write a custom parser for spec files this does not have to be true. You can look up a method and append to its comment instead of overwriting it just like for a class.
from rdoc.
Great, then it's just a matter of ensuring the correct ordering (ie: stdlib and then the specs).
from rdoc.
And writing a parser for specs, of course
from rdoc.
Closing this bug as I am not going to write the spec parser.
from rdoc.
No problem, thanks for the information :)
from rdoc.
Related Issues (20)
- Enumerable#inject has incorrect examples HOT 2
- [Bug] Cannot link to constants in Markdown
- Incorrect module aliasing
- [Bug] Cannot insert a link after a left curly bracket appears HOT 1
- [Feature Request] Remove comments which starts with :no-doc
- [Bug] Symbol is modified when declared with %s HOT 1
- [Bug] rdoc doesn't detect heredoc comments HOT 1
- Unstable TestRDocGeneratorJsonIndex#test_generate test HOT 5
- Attributes not in methods TOC? HOT 3
- `rb_file_const` is not working
- Internationalize hardcoded rdoc-ref links
- rdoc non-determinism: module includes can be added once or twice to generated .ri
- Including modules creates an infinite loop between methods
- PLEASE make cross references actually work w/ ri HOT 6
- RDoc doesn't have complete files when being installed from git/github source HOT 6
- More documentation for methods in RDoc
- [Proposal] Add user guide, especially about directives HOT 3
- [Proposal] `bundle exec rdoc` command should work for rdoc itself HOT 4
- Bad performance during mixin resolution
- LoadError does not get automatically linked by RDoc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rdoc.