Skip to content

Commit

Permalink
Fix CI with latest yard
Browse files Browse the repository at this point in the history
Monkey patching libraries is a bad idea.  Latest version of yard changed
some internal details, which broke CI.

A workaround was proposed in puppetlabs#401 but the root cause was not addressed.

In this commit, we replace the private `io` object with an instance of a
class that provide the expected `IO#write` method instead of `nil` which
does not provide this interface in CI, so that the issue is not raised
anymore.
  • Loading branch information
smortex committed Oct 31, 2024
1 parent a4be216 commit b7a5d87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion puppet-strings.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Gem::Specification.new do |s|
s.files = Dir['CHANGELOG.md', 'README.md', 'LICENSE', 'lib/**/*', 'exe/**/*']

s.add_runtime_dependency 'rgen', '~> 0.9'
s.add_runtime_dependency 'yard', '~> 0.9', '< 0.9.37'
s.add_runtime_dependency 'yard', '~> 0.9'
s.requirements << 'puppet, >= 7.0.0'
end
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
YARD::Logger.instance.io = original_yard_logging_object
end

class NullLogger
def write(_message); end
end

def suppress_yard_logging
YARD::Logger.instance.io = nil
YARD::Logger.instance.io = NullLogger.new
end

describe 'parsing source without a data type definition' do
Expand Down

0 comments on commit b7a5d87

Please sign in to comment.