Skip to content

Commit b7a5d87

Browse files
committed
Fix CI with latest yard
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.
1 parent a4be216 commit b7a5d87

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: puppet-strings.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ Gem::Specification.new do |s|
2323
s.files = Dir['CHANGELOG.md', 'README.md', 'LICENSE', 'lib/**/*', 'exe/**/*']
2424

2525
s.add_runtime_dependency 'rgen', '~> 0.9'
26-
s.add_runtime_dependency 'yard', '~> 0.9', '< 0.9.37'
26+
s.add_runtime_dependency 'yard', '~> 0.9'
2727
s.requirements << 'puppet, >= 7.0.0'
2828
end

Diff for: spec/unit/puppet-strings/yard/handlers/ruby/data_type_handler_spec.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
YARD::Logger.instance.io = original_yard_logging_object
1919
end
2020

21+
class NullLogger
22+
def write(_message); end
23+
end
24+
2125
def suppress_yard_logging
22-
YARD::Logger.instance.io = nil
26+
YARD::Logger.instance.io = NullLogger.new
2327
end
2428

2529
describe 'parsing source without a data type definition' do

0 commit comments

Comments
 (0)