Skip to content

Instantly share code, notes, and snippets.

@astagi
Created September 27, 2018 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astagi/d4fd51ffc2a57b325bd26cd4588896ef to your computer and use it in GitHub Desktop.
Save astagi/d4fd51ffc2a57b325bd26cd4588896ef to your computer and use it in GitHub Desktop.
require 'yard'
require 'fileutils'
YARD::Rake::YardocTask.new do |t|
dynamic_dir = File.join('lib', 'ansa', 'docs')
dynamic_file = File.join(dynamic_dir, 'dynamic_docs.rb')
FileUtils.mkdir_p dynamic_dir
f = File.new(dynamic_file, 'w')
f.write("module Ansa")
Ansa::LINKS.each do |category, url|
f.write("\n generate_get_news '#{category}', '#{url}'")
end
f.write("\nend")
f.close()
t.files = ['lib/**/*.rb']
t.stats_options = ['--list-undoc']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment