Skip to content

Dup frozen strings #9291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/puppet/reference/indirection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
text << Puppet::Util::Docs.scrub(ind.doc) + "\n\n"

Puppet::Indirector::Terminus.terminus_classes(ind.name).sort_by(&:to_s).each do |terminus|
# this is an "abstract" terminus, ignore it
next if ind.name == :resource && terminus == :validator

terminus_name = terminus.to_s
term_class = Puppet::Indirector::Terminus.terminus_class(ind.name, terminus)
if term_class
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/reference/metaparameter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

## Available Metaparameters

}
}.dup
begin
params = []
Puppet::Type.eachmetaparam { |param|
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/reference/providers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
command_line = Puppet::Util::CommandLine.new
types.reject! { |type| !command_line.args.include?(type.name.to_s) } unless command_line.args.empty?

ret = "Details about this host:\n\n"
ret = "Details about this host:\n\n".dup

# Throw some facts in there, so we know where the report is from.
ret << option('Ruby Version', Facter.value('ruby.version'))
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/reference/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
Resource types define features they can use, and providers can be tested to see
which features they provide.

}
}.dup

types.sort_by(&:to_s).each { |name, type|
str << "
Expand Down
22 changes: 16 additions & 6 deletions spec/integration/application/doc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@
.and output(/configuration - A reference for all settings/).to_stdout
end

it 'generates markdown' do
app.command_line.args = ['-r', 'report']
expect {
app.run
}.to exit_with(0)
.and output(/# Report Reference/).to_stdout
{
'configuration' => /# Configuration Reference/,
'function' => /# Function Reference/,
'indirection' => /# Indirection Reference/,
'metaparameter' => /# Metaparameter Reference/,
'providers' => /# Provider Suitability Report/,
'report' => /# Report Reference/,
'type' => /# Type Reference/
}.each_pair do |type, expected|
it "generates #{type} reference" do
app.command_line.args = ['-r', type]
expect {
app.run
}.to exit_with(0)
.and output(expected).to_stdout
end
end
end