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

SitemapGenerator.verbose = false does not seem to work #332

Open
jrochkind opened this issue Aug 29, 2019 · 1 comment
Open

SitemapGenerator.verbose = false does not seem to work #332

jrochkind opened this issue Aug 29, 2019 · 1 comment

Comments

@jrochkind
Copy link

I have an automated test of my sitemap generation.

This causes the sitemap_generator output to annoyingly show up in the middle of my test output, when I run tests over that. Eg.

..................In '/Users/jrochkind/code/scihist_digicoll/public/':
+ __sitemaps/sitemap.xml.gz                               14 links /  569 Bytes
Sitemap stats: 14 links / 1 sitemaps / 0m00s
............

It looks like I should be able to disable this with SitemapGenerator.verbose = false. But this does not work, the output is still there.

Debugging... the verbose flag is somehow being set to <Object:0x00007fc92aa54470>, what? Trying to debug this, there's a lot of abstract indirection making it hard....

Aha, right here:

SitemapGenerator::Interpreter.run(:config_file => ENV["CONFIG_FILE"], :verbose => verbose)

It's getting that verbose value from Rake itself. Indeed I am testing by running Rake::Task["sitemap:create"].invoke

So it appears when running the rake task, the rake setting for "verbose" takes priority, and SitemapGenerator.verbose is ignored. OK, that could be intended?

@jrochkind
Copy link
Author

Okay, finding the right place to set that rake verbose flag to false programmatically is a bit tricky, it appears to be:

Rake::FileUtilsExt.verbose(false)

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

No branches or pull requests

1 participant