Sha256: ca00dab7c2945e2dd767a7a4abc6f1bbe76951ee8bd921286a01ca4f28ecfd94
Contents?: true
Size: 845 Bytes
Versions: 10
Compression:
Stored size: 845 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.gsub('_', '-') 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
10 entries across 10 versions & 3 rubygems