Sha256: d6d56a72379f8f1344756e516386ad0478a1d532a3f40480d05906dfbf5feecd

Contents?: true

Size: 802 Bytes

Versions: 7

Compression:

Stored size: 802 Bytes

Contents

require_relative 'puppet_plan'

module PuppetStrings::Markdown
  module PuppetPlans

    # @return [Array] list of classes
    def self.in_plans
      arr = YARD::Registry.all(:puppet_plan).sort_by!(&:name).map!(&:to_hash)
      arr.map! { |a| PuppetStrings::Markdown::PuppetPlan.new(a) }
    end

    def self.contains_private?
      result = false
      unless in_plans.nil?
        in_plans.find { |plan| plan.private? }.nil? ? false : true
      end
    end

    def self.render
      final = in_plans.length > 0 ? "## Plans\n\n" : ""
      in_plans.each do |plan|
        final << plan.render unless plan.private?
      end
      final
    end

    def self.toc_info
      final = ["Plans"]

      in_plans.each do |plan|
        final.push(plan.toc_info)
      end

      final
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
puppet-strings-2.5.0 lib/puppet-strings/markdown/puppet_plans.rb
puppet-strings-2.4.0 lib/puppet-strings/markdown/puppet_plans.rb
puppet-strings-2.3.1 lib/puppet-strings/markdown/puppet_plans.rb
puppet-strings-2.3.0 lib/puppet-strings/markdown/puppet_plans.rb
puppet-strings-2.2.0 lib/puppet-strings/markdown/puppet_plans.rb
puppet-strings-2.1.0 lib/puppet-strings/markdown/puppet_plans.rb
puppet-strings-2.0.0 lib/puppet-strings/markdown/puppet_plans.rb