11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/asciidoctor/confluence/invoker.rb', line 11
def self.invoke(args)
begin
orig_stdout, orig_stderr = $stdout, $stderr
captured_stdout, captured_stderr = StringIO.new, StringIO.new
$stdout, $stderr = captured_stdout, captured_stderr
options = Asciidoctor::Confluence::Options.parse! args
unless invoke_helper_or_version(args)
publisher = Asciidoctor::Confluence::Publisher.new options
publisher.publish
end
ensure
$stderr = orig_stdout
$stdout = orig_stderr
$stderr.puts captured_stderr.string
$stdout.puts captured_stdout.string
end
end
|