Questions tagged [yard]

YARD stands for "Yay! A Ruby Documentation tool". It is considered an alternative to the rdoc tool with more features.

YARD stands for "Yay! A Ruby Documentation tool". It is considered an alternative to the rdoc tool with more features. The YARD website says:

YARD is a documentation generation tool for the Ruby programming language. It enables the user to generate consistent, usable documentation that can be exported to a number of formats very easily, and also supports extending for custom Ruby constructs such as custom class level definitions.

YARD's notable features include:

  • Preview as you document
  • Easily customize templates
  • Support your own DSL
  • Extend, extend, extend!

And of course YARD comes with much more functionality, including the ability to serve documentation for gems, the ability to group methods into logical sections, and much more.

195 questions
0
votes
1 answer

How to document Rspec's let type

Lets say I have following code let(:document) { FactoryBot.create :document } let(:mail) do # @type [User] celebrated_user = FactoryBot.create :user # @type [Rule] rule = FactoryBot.create :rule, document: document …
Mailo Světel
  • 24,002
  • 5
  • 30
  • 40
0
votes
0 answers

RubyMine suppression comments ignored by YARD?

I have been writing some Ruby code using RubyMine, which I have really learned to like, and have been using YARD for documentation. I have come across a minor bothersome issue, that I have been unable to find an elegant solution for. RubyMine…
ForeverZer0
  • 2,379
  • 1
  • 24
  • 32
0
votes
1 answer

Documenting parameters for macro generated methods with YARD

Give the following input: class A # @!macro [attach] add_setting # @!attribute [rw] $1 # @!method $1=(value) def self.add_setting(setting) end # @param value [String] Hexadecimal representation of color add_setting…
Xavier Shay
  • 4,067
  • 1
  • 30
  • 54
0
votes
1 answer

Documenting Sinatra routes for extensions (Yard::Sinatra doesn't work)

I am writing a moderate-sized Sinatra app that I break into extensions, placed in ./lib/extensions/. I want to document each route, but Yard::Sinatra only documents the routes defined in the main application.rb file. Can I configure Yard::Sinatra to…
Kui Tang
  • 195
  • 7
0
votes
1 answer

YARD: Document non-useful or unintentional return

I have an impure function like so: # Impure function: Sets the status for a report_schedule, uses last_sent to # calculate status # @param report_schedule [Hash] # @return [String] Non-useful: value of last_sent that was set def…
Achyut Rastogi
  • 1,335
  • 2
  • 11
  • 15
0
votes
2 answers

Hint or infer the return type for RSpec let() implementing FactoryGirl create()

Using RubyMine, in an rspec test, is there a way to let RubyMine know the type of the created object (for auto-completion and 'cannot find ' warning suppression? eg: # @yieldreturn [Tibbees::Tibbee] let!(:tibbee) { create(:tibbee, …
Justin Maxwell
  • 159
  • 2
  • 9
0
votes
1 answer

Error: yard not installed

I have a problem with redmine plugin migration. While migrating: exec rake redmine:plugins:migrate RAILS_ENV=production I get errors: /var/lib/gems/2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key "inodot" is…
Anton
  • 121
  • 8
0
votes
1 answer

Permission denied @ rb_sysopen - .yardoc/processing

aleksiares@unit:~/wasteland/sokol_dev$ yard /usr/local/rvm/gems/ruby-2.2.0/gems/yard-0.9.5/lib/yard/core_ext/file.rb:56:in `initialize': Permission denied @ rb_sysopen - .yardoc/processing (Errno::EACCES) from…
0
votes
1 answer

With 'yard', how can I document a wildcard parameter like "def foo(*args)"

Say I have a method like this # @return [Integer] number of arguments provided to the method def return_number_of_arguments(*args) return args.length end How could I add @param documentation? Ideas I have: @param [*Object] any objects but I…
max pleaner
  • 26,189
  • 9
  • 66
  • 118
0
votes
1 answer

Rdoc, YARD and irb, using intern method on an array?

I was just trying to generate the documentation for my gem, and upon running either rdoc or yard I got the error undefined method `intern' for []:Array What is going on? I've trying reinstalling everything, and I'm on ruby 2.3.1. Also, from what I…
thesecretmaster
  • 1,950
  • 1
  • 27
  • 39
0
votes
0 answers

service to auto generate and host yardocs?

Is there a service that can pull from our github repo and generate and host our yard docs? It seems my team never looks at our docs since they have to generate them locally and then navigate to them. This is also causing them to stop writing helpful…
Deekor
  • 9,144
  • 16
  • 69
  • 121
0
votes
1 answer

YARD - resource handler - documenting defs declared in .each block

How can I write documentation for definitions that are gathered in an .each block? My particular case is Middleman, but I think the problem is more generalized, and Google is being disappointing today. For example: def…
balthisar
  • 185
  • 1
  • 15
0
votes
1 answer

yard-rspec-plugin and support for modules

I am trying to get the yard-rpec-plugin to work. For the given example it works, but when I add a module (as my code has), it does not give the rspec info in the doc. To give an example, the following does not work, but leave out the 'Module Test'…
Axe
  • 672
  • 6
  • 19
0
votes
2 answers

yard server generate Documentation from github repo

Is there any way to generate Yard documentation from github projects. We have several cookbook with Yard tags ready for parsing with Yard and generating documentation. Any Ideas? Thanks Biswajit
Biswajit Das
  • 644
  • 7
  • 26
0
votes
1 answer

How can I document config_accessor methods in YARD with TomDoc syntax?

I'm working on code that includes ActiveSupport's Configurable module and I'm trying to document the config accessors. Anybody know how to do so in YARD Tomdoc? I've tried the following but it doesn't seem to render anything in the docs. class…
bodacious
  • 6,608
  • 9
  • 45
  • 74
1 2 3
12
13