diff --git a/lib/puppet-strings/markdown.rb b/lib/puppet-strings/markdown.rb index 909576f..6bc3b61 100644 --- a/lib/puppet-strings/markdown.rb +++ b/lib/puppet-strings/markdown.rb @@ -5,7 +5,7 @@ module PuppetStrings::Markdown require_relative 'markdown/puppet_classes' require_relative 'markdown/functions' require_relative 'markdown/defined_types' - require_relative 'markdown/custom_types' + require_relative 'markdown/resource_types' require_relative 'markdown/table_of_contents' # generates markdown documentation @@ -15,7 +15,7 @@ module PuppetStrings::Markdown final << PuppetStrings::Markdown::TableOfContents.render final << PuppetStrings::Markdown::PuppetClasses.render final << PuppetStrings::Markdown::DefinedTypes.render - final << PuppetStrings::Markdown::CustomTypes.render + final << PuppetStrings::Markdown::ResourceTypes.render final << PuppetStrings::Markdown::Functions.render final diff --git a/lib/puppet-strings/markdown/custom_type.rb b/lib/puppet-strings/markdown/resource_type.rb similarity index 86% rename from lib/puppet-strings/markdown/custom_type.rb rename to lib/puppet-strings/markdown/resource_type.rb index 967bb35..3645c93 100644 --- a/lib/puppet-strings/markdown/custom_type.rb +++ b/lib/puppet-strings/markdown/resource_type.rb @@ -1,9 +1,9 @@ require 'puppet-strings/markdown/base' module PuppetStrings::Markdown - class CustomType < Base + class ResourceType < Base def initialize(registry) - @template = 'custom_type.erb' + @template = 'resource_type.erb' super(registry, 'type') end diff --git a/lib/puppet-strings/markdown/custom_types.rb b/lib/puppet-strings/markdown/resource_types.rb similarity index 68% rename from lib/puppet-strings/markdown/custom_types.rb rename to lib/puppet-strings/markdown/resource_types.rb index b2c9660..214a885 100644 --- a/lib/puppet-strings/markdown/custom_types.rb +++ b/lib/puppet-strings/markdown/resource_types.rb @@ -1,7 +1,7 @@ -require_relative 'custom_type' +require_relative 'resource_type' module PuppetStrings::Markdown - module CustomTypes + module ResourceTypes # @return [Array] list of resource types def self.in_rtypes @@ -11,7 +11,7 @@ module PuppetStrings::Markdown def self.render final = in_rtypes.length > 0 ? "## Resource types\n\n" : "" in_rtypes.each do |type| - final << PuppetStrings::Markdown::CustomType.new(type).render + final << PuppetStrings::Markdown::ResourceType.new(type).render end final end @@ -20,7 +20,7 @@ module PuppetStrings::Markdown final = [] in_rtypes.each do |type| - final.push(PuppetStrings::Markdown::CustomType.new(type).toc_info) + final.push(PuppetStrings::Markdown::ResourceType.new(type).toc_info) end final diff --git a/lib/puppet-strings/markdown/table_of_contents.rb b/lib/puppet-strings/markdown/table_of_contents.rb index 16f5726..3afa119 100644 --- a/lib/puppet-strings/markdown/table_of_contents.rb +++ b/lib/puppet-strings/markdown/table_of_contents.rb @@ -3,7 +3,7 @@ module PuppetStrings::Markdown def self.render puppet_classes = PuppetStrings::Markdown::PuppetClasses.toc_info puppet_defined_types = PuppetStrings::Markdown::DefinedTypes.toc_info - puppet_resource_types = PuppetStrings::Markdown::CustomTypes.toc_info + puppet_resource_types = PuppetStrings::Markdown::ResourceTypes.toc_info puppet_functions = PuppetStrings::Markdown::Functions.toc_info template = File.join(File.dirname(__FILE__),"templates/table_of_contents.erb") diff --git a/lib/puppet-strings/markdown/templates/custom_type.erb b/lib/puppet-strings/markdown/templates/resource_type.erb similarity index 100% rename from lib/puppet-strings/markdown/templates/custom_type.erb rename to lib/puppet-strings/markdown/templates/resource_type.erb diff --git a/spec/unit/puppet-strings/markdown_spec.rb b/spec/unit/puppet-strings/markdown_spec.rb index 1adb923..11cfbf3 100644 --- a/spec/unit/puppet-strings/markdown_spec.rb +++ b/spec/unit/puppet-strings/markdown_spec.rb @@ -216,7 +216,7 @@ SOURCE describe 'rendering markdown to a file' do it 'should output the expected markdown content' do - File.open('/Users/eric.putnam/src/puppet-strings/md.md', 'w') do |file| + Tempfile.open('md') do |file| PuppetStrings::Markdown.render(file.path) expect(File.read(file.path)).to eq(baseline) end