diff --git a/lib/puppet-strings/markdown/base.rb b/lib/puppet-strings/markdown/base.rb index cb43c6b..c35202b 100644 --- a/lib/puppet-strings/markdown/base.rb +++ b/lib/puppet-strings/markdown/base.rb @@ -47,9 +47,6 @@ module PuppetStrings::Markdown # ") inherits foo::bar {\n" + # "}"} class Base - - DISPLAYED_TAGS = %w[summary see since version param raise option overload] - def initialize(registry, component_type) @type = component_type @registry = registry @@ -130,7 +127,7 @@ module PuppetStrings::Markdown { name: name.to_s, link: link, - desc: summary || @registry[:docstring][:text].gsub("\n", ". "), + desc: summary || @registry[:docstring][:text][0..140].gsub("\n",' '), private: private? } end @@ -162,14 +159,6 @@ module PuppetStrings::Markdown result end - def contains_displayed_tags? - result = @registry[:docstring][:text] ? true : false - @tags.each do |tag| - result = true if DISPLAYED_TAGS.include? tag[:tag_name] - end - result - end - # @return [String] full markdown rendering of a component def render(template) file = File.join(File.dirname(__FILE__),"templates/#{template}") diff --git a/spec/unit/puppet-strings/markdown/base_spec.rb b/spec/unit/puppet-strings/markdown/base_spec.rb index fa254eb..c1e2716 100644 --- a/spec/unit/puppet-strings/markdown/base_spec.rb +++ b/spec/unit/puppet-strings/markdown/base_spec.rb @@ -5,6 +5,7 @@ describe PuppetStrings::Markdown::Base do before :each do YARD::Parser::SourceParser.parse_string(<<-SOURCE, :puppet) # An overview +# @api private # @summary A simple class. # @param param1 First param. # @param param2 Second param. @@ -36,6 +37,12 @@ SOURCE end + describe '#private?' do + it do + expect(component.private?).to be true + end + end + describe '#params' do it 'returns the expected params' do expect(component.params.size).to eq 3 @@ -126,7 +133,7 @@ SOURCE expect(toc).to be_instance_of Hash end it 'uses overview for :desc in absence of summary' do - expect(toc[:desc]).to eq 'An overview. It\'s a longer overview. Ya know?' + expect(toc[:desc]).to eq 'An overview It\'s a longer overview Ya know?' end end