remove displayed tag business

This commit is contained in:
Eric Putnam 2018-02-26 13:24:06 -08:00
parent 6923d9e18c
commit 65bfdaf1de
No known key found for this signature in database
GPG Key ID: 3FB595AA224A7751
2 changed files with 9 additions and 13 deletions

View File

@ -47,9 +47,6 @@ module PuppetStrings::Markdown
# ") inherits foo::bar {\n" + # ") inherits foo::bar {\n" +
# "}"} # "}"}
class Base class Base
DISPLAYED_TAGS = %w[summary see since version param raise option overload]
def initialize(registry, component_type) def initialize(registry, component_type)
@type = component_type @type = component_type
@registry = registry @registry = registry
@ -130,7 +127,7 @@ module PuppetStrings::Markdown
{ {
name: name.to_s, name: name.to_s,
link: link, link: link,
desc: summary || @registry[:docstring][:text].gsub("\n", ". "), desc: summary || @registry[:docstring][:text][0..140].gsub("\n",' '),
private: private? private: private?
} }
end end
@ -162,14 +159,6 @@ module PuppetStrings::Markdown
result result
end 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 # @return [String] full markdown rendering of a component
def render(template) def render(template)
file = File.join(File.dirname(__FILE__),"templates/#{template}") file = File.join(File.dirname(__FILE__),"templates/#{template}")

View File

@ -5,6 +5,7 @@ describe PuppetStrings::Markdown::Base do
before :each do before :each do
YARD::Parser::SourceParser.parse_string(<<-SOURCE, :puppet) YARD::Parser::SourceParser.parse_string(<<-SOURCE, :puppet)
# An overview # An overview
# @api private
# @summary A simple class. # @summary A simple class.
# @param param1 First param. # @param param1 First param.
# @param param2 Second param. # @param param2 Second param.
@ -36,6 +37,12 @@ SOURCE
end end
describe '#private?' do
it do
expect(component.private?).to be true
end
end
describe '#params' do describe '#params' do
it 'returns the expected params' do it 'returns the expected params' do
expect(component.params.size).to eq 3 expect(component.params.size).to eq 3
@ -126,7 +133,7 @@ SOURCE
expect(toc).to be_instance_of Hash expect(toc).to be_instance_of Hash
end end
it 'uses overview for :desc in absence of summary' do 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
end end