This repository has been archived by the owner on Aug 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #349 from jpogran/maint-pay-down-tech-debt
(maint) Pay down tech debt
- Loading branch information
Showing
7 changed files
with
360 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module Dsc | ||
class DocumentBuilder < Manager | ||
|
||
def document_types(markdown_file_path) | ||
puts "Creating #{markdown_file_path}" | ||
File.open("#{markdown_file_path}", 'w+') do |file| | ||
file.write("## Resource Types included with DSC module\n") | ||
file.write("For any system this module is installed on, use\n`Puppet describe typename` for more information.\n\n") | ||
|
||
file.write("#### WMF Core Types\n\n") | ||
file.write("Puppet Type | DSC Resource\n") | ||
file.write("----------- | -----------------\n") | ||
resources.select { |t| t.instance_name.downcase.match(/dsc_[^x]/)}.each do |dsc_type| | ||
pth = File.dirname(dsc_type.relative_mof_path.gsub(/import\/dsc_resources/,"build/vendor/wmf_dsc_resources")) | ||
file.write("dsc_#{dsc_type.friendlyname.downcase} | [#{dsc_type.friendlyname}](https://github.com/puppetlabs/puppetlabs-dsc/tree/master/#{pth}) | #{dsc_type.relative_mof_path}\n") | ||
end | ||
|
||
file.write("\n#### Community x Prefixed types\n\n") | ||
resources.select { |t| t.instance_name.downcase.match(/dsc_x/)}.group_by { |dt| dt.ps_module.name}.each do |dsc_type| | ||
file.write("##### #{dsc_type[0]}\n\n") | ||
file.write("Puppet Type | DSC Resource | Github Repo\n") | ||
file.write("----------- | ----------------- | -----\n") | ||
dsc_type[1].each do | sb | | ||
pth = File.dirname(sb.relative_mof_path.gsub(/import\/dsc_resources/,"lib/puppet_x/dsc_resources")) | ||
file.write("dsc_#{sb.friendlyname.downcase} | [#{sb.friendlyname}](https://github.com/puppetlabs/puppetlabs-dsc/tree/master/#{pth}) | [repo](https://github.com/PowerShell/#{dsc_type[0]})\n") | ||
end | ||
file.write("\n") | ||
end | ||
end | ||
end | ||
|
||
end | ||
end |
Oops, something went wrong.