Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I insert Rdoc comments in RubyMine

Tags:

rubymine

rdoc

When I used Visual Studio I was used to inserting XML comments with just a few key presses at the beginning of the method definition (I think /// but it's been a while). Is there a way to insert an RDoc comment before a method inside of RubyMine out of the box? If so what is the keyboard shortcut?

like image 406
Jared Avatar asked Dec 12 '12 23:12

Jared


People also ask

What is RDoc format?

RDoc, designed by Dave Thomas, is an embedded documentation generator for the Ruby programming language. It analyzes Ruby source code, generating a structured collection of pages for Ruby objects and methods. Code comments can be added in a natural style.

How do I create a RDOC?

rdoc is generated when the gem is installed (using gem install --no-rdoc [name] skips the local rdoc generation). You can then use gem server to view your local gem rdoc at http://localhost:8808. YARD is an interesting project by Loren Segal to create a next generation Ruby documentation system.


1 Answers

I have a similar problem, and the default alt enter way is not very good. You have to alt enter many times, and the generated type is always Object.

So I write a plugin to do this trick,

example

And I have uploaded the plugin to JetBrains (Plugin Repository), you can search ruby-doc-adder to download and use it.

https://plugins.jetbrains.com/plugin/9904-ruby-doc-adder.

Also see the readme for usages.

like image 194
aristotll Avatar answered Nov 07 '22 01:11

aristotll