Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timings command option and fix timings #695

Merged
merged 2 commits into from
Oct 23, 2018

Conversation

robertpanzer
Copy link
Member

This PR adds a -t command line option to align with the original asciidoctor command.
Previously the timings should've been printed when starting with -v (verbose mode).

But it looks like this didn't even work, as the timings are now managed by the Asciidoctor::Timings class which has to be present in the options.
I fixed this by explicitly creating such an instance, and then after the rendering calling this to print its report, so that the report should also look identically to what asciidoctor produces.

Along the way I also found an error in the tests regarding the destination dir option -D.
The test destination_dir_should_render_files_to_ouput_directory() also fails on the current master when running in isolation.
It only succeeded because the test verbose_option_should_fill_monitor_map() was executed before.


if (asciidoctorCliOptions.isVersion()) {
System.out.println("Asciidoctor " + asciidoctor.asciidoctorVersion() + " [http://asciidoctor.org]");
return;
}

if (asciidoctorCliOptions.isVerbose()) {
JRubyRuntimeContext.get().evalScriptlet("$VERBOSE=true");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this again, as it was apparently handled in the same way below in setVerboseLevel() which I oversaw.

@robertpanzer robertpanzer merged commit 69af7e2 into asciidoctor:master Oct 23, 2018
@robertpanzer robertpanzer deleted the timings branch October 23, 2018 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant