The answer is probably 'No! Why on earth would you want to do that?'
but, I have to ask. Is there an Rdoc directive that forces an
arbitrary line of Ruby code into the document?
I have this sort of thing in a Cucumber step_definition file:
When /this has to match/ do
When /this also matches "(.*)"/ do |x|
When /another match for (\d+)/ do /digit/
And I would like to just include the line beginning with 'When' into
the Rdoc file. However, I cannot seem to find any way of doing
this.
I verified that the the file get processed by Rdoc because I added a
section statement and that shows up. But, the only way I have
discovered to get the desired lines into the document is to extend the
section to include a comment for each step definition, which is hardly
DRY.
It seemed to me that the meta-programming comment tag (##) might work
but it does not. And, further, all the comments in the file that
follow the first blank line in the section portion do not get
included, so that I cannot even keep the step_definition comments
directly above the associated step_definition statements.
Any suggestions on how to deal with this are welcomed.
The answer is probably 'No! Why on earth would you want to do that?'
but, I have to ask. Is there an Rdoc directive that forces an
arbitrary line of Ruby code into the document?
I have this sort of thing in a Cucumber step_definition file:
When /this has to match/ do
When /this also matches "(.*)"/ do |x|
When /another match for (\d+)/ do /digit/
And I would like to just include the line beginning with 'When' into
the Rdoc file. However, I cannot seem to find any way of doing
this.
You'll probably need to write a custom parser. The rdoc-rake gem has such a custom parser for Rakefiles you could look at for an example.
I verified that the the file get processed by Rdoc because I added a
section statement and that shows up. But, the only way I have
discovered to get the desired lines into the document is to extend the
section to include a comment for each step definition, which is hardly
DRY.
It seemed to me that the meta-programming comment tag (##) might work
but it does not. And, further, all the comments in the file that
follow the first blank line in the section portion do not get
included, so that I cannot even keep the step_definition comments
directly above the associated step_definition statements.
Any suggestions on how to deal with this are welcomed.
Can you link to an example file you want RDoc to process?
···
On May 10, 2010, at 13:25, byrnejb wrote:
You'll probably need to write a custom parser. The rdoc-rake
gem has such a custom parser for Rakefiles you could look at
for an example.
. . .
Can you link to an example file you want RDoc to process?
Is a gist ok or do you need an actual file to download?
···
On May 10, 7:34 pm, Eric Hodel <drbr...@segment7.net> wrote:
the gist is fine. anything you can convey will work.
···
On May 11, 2010, at 09:17 , byrnejb wrote:
On May 10, 7:34 pm, Eric Hodel <drbr...@segment7.net> wrote:
You'll probably need to write a custom parser. The rdoc-rake
gem has such a custom parser for Rakefiles you could look at
for an example.
. . .
Can you link to an example file you want RDoc to process?
Is a gist ok or do you need an actual file to download?
you need an actual file to download?
the gist is fine. anything you can convey will work.
http://gist.github.com/404024
What I would like to see in the generated rdoc file from this is
something like:
cucumber_steps matchers
The following matchers are available
When /display the current page/ do
When /do log the sql/ do
When /visits? (?:an?|the) application URL/i do
···
On May 11, 4:20 pm, Ryan Davis <ryand-r...@zenspider.com> wrote:
---
tag for search: byrnejb
you need an actual file to download?
the gist is fine. anything you can convey will work.
http://gist.github.com/404024
What I would like to see in the generated rdoc file from this is
something like:
cucumber_steps matchers
The following matchers are available
When /display the current page/ do
When /do log the sql/ do
When /visits? (?:an?|the) application URL/i do
···
On May 11, 4:20 pm, Ryan Davis <ryand-r...@zenspider.com> wrote:
---
tag for search: byrnejb