File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11require 'fileutils'
2+ require 'open3'
23require_relative '../xref_test_case'
34
45class Helper
@@ -22,11 +23,17 @@ def self.run_rdoc(markup, method)
2223 rdoc_filename = filestem + '.rdoc'
2324 File . write ( rdoc_filename , markup )
2425 # Run rdoc, to create the HTML file.
25- html_dirname = 'html'
26- `rdoc --op html #{ rdoc_filename } #{ html_dirname } `
26+ command = "rdoc #{ rdoc_filename + 'xxx' } "
27+ puts command
28+ Open3 . popen3 ( command ) do |_ , stdout , stderr |
29+ stdout_s = stdout . read
30+ raise RuntimeError . new ( stdout_s ) unless stdout_s . match ( 'Parsing' )
31+ stderr_s = stderr . read
32+ raise RuntimeError . new ( stderr_s ) unless stderr_s . match ( 'Generating' )
33+ end
2734 # Get the HTML as lines.
2835 html_filename = filestem + '_rdoc.html'
29- html_filepath = File . join ( html_dirname , html_filename )
36+ html_filepath = File . join ( 'doc' , html_filename )
3037 html_lines = File . readlines ( html_filepath )
3138 # Yield them.
3239 yield html_lines
You can’t perform that action at this time.
0 commit comments