Sha256: a117e283ead60ea6dbaa8e96f43fad5d4228aa591353eb1b7a2d57957bed518e
Contents?: true
Size: 843 Bytes
Versions: 27
Compression:
Stored size: 843 Bytes
Contents
namespace :docs do AUTOGEN_WARNING = <<-EOD <!-- WARNING: Please DO NOT edit this file! Update source documentation in lib/active_admin/views and execute rake yard to regenerate it. --> EOD def filename_from_module(mod) mod.name.to_s.underscore.tr('_', '-') end def write_docstrings_to(path, mods) mods.each do |mod| File.open("#{path}/#{filename_from_module(mod)}.md", 'w+') do |f| f << AUTOGEN_WARNING + mod.docstring + "\n" end end end desc "Update docs in the docs folder" task :build do require 'yard' require 'active_support/all' YARD::Registry.load! views = YARD::Registry.at("ActiveAdmin::Views") # Index Types index_types = views.children.select{|obj| obj.name.to_s =~ /^IndexAs/ } write_docstrings_to "docs/3-index-pages", index_types end end
Version data entries
27 entries across 27 versions & 4 rubygems