Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request puppetlabs#9291 from joshcooper/dup_frozen_strings
Browse files Browse the repository at this point in the history
Dup frozen strings
  • Loading branch information
mhashizume authored Mar 12, 2024
2 parents e523f18 + d89dc82 commit 1a53bf7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
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

0 comments on commit 1a53bf7

Please sign in to comment.