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

Version Path
activeadmin_addons-1.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-a5a53c3f2b8f/tasks/docs.rake
activeadmin_addons-1.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/tasks/docs.rake
yousty-activeadmin-1.0.17.pre tasks/docs.rake
yousty-activeadmin-1.0.16.pre tasks/docs.rake
activeadmin_addons-1.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/tasks/docs.rake
activeadmin_addons-1.0.1 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/tasks/docs.rake
activeadmin_addons-1.0.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-a5a53c3f2b8f/tasks/docs.rake
yousty-activeadmin-1.0.15.pre tasks/docs.rake
activeadmin-1.0.0 tasks/docs.rake
activeadmin-1.0.0.pre5 tasks/docs.rake
activeadmin-orac-1.0.0.pre4 tasks/docs.rake
activeadmin-orac-1.0.0 tasks/docs.rake
activeadmin-orac-1.0.0.pre.orac tasks/docs.rake
yousty-activeadmin-1.0.14.pre tasks/docs.rake
yousty-activeadmin-1.0.13.pre tasks/docs.rake
yousty-activeadmin-1.0.12.pre tasks/docs.rake
yousty-activeadmin-1.0.11.pre tasks/docs.rake
yousty-activeadmin-1.0.10.pre tasks/docs.rake
yousty-activeadmin-1.0.9.pre tasks/docs.rake
yousty-activeadmin-1.0.8.pre tasks/docs.rake