Closed movitto closed 10 years ago
~~Checked commit https://github.com/ManageIQ/polisher/commit/e2b7f95706fba37a949a33779d7b58e778943c10 with rubocop 1 file checked, 15 offenses detected~~
Updated to address previous rubocop feedback, not quite sure why its complaining about the hash alignment, looks aligned to me.
Checked commit https://github.com/ManageIQ/polisher/commit/fdd4f7f7b41905743d06e7737872db0cfa88e8f8 with rubocop 1 file checked, 0 offenses detected
Everything looks good. :+1:
General question, but it seems you are building both XML and JSON by hand. Is there a gem that can do this for you? For example, I know the json gem gives you .to_json, and I think nokogiri or something else might give you .to_xml. If not, there are many builder things that will build it for you, just as JBuilder and Nokogiri::XML::Builder . Perhaps there's a gem that does both and then you just emit what you want.
@Fryguy will look into this, though a little trickier than described. The output gets constructed & printed out on the fly as the gemfile & dependencies are evaluated (recursively). This is so the user doesn't have to wait until all gems are extracted and looked up against all targets before receiving results.
Not sure how feasible it is to process / output the data on the fly w/ those 3rd party libraries as suggested but will look into it. Or perhaps in the 'xml' / 'json' / other machine-readable output case we can skip this and just collect the data ahead of time / generate it all at once
@movitto Let's open an issue with @Fryguy's concerns about building xml/json by hand. I think we can build hashes as you go through each item of work so we can present that information when it completes.
I think we can merge this for now, but come back to that issue if we need to add more output in the future as then it's probably the time to find a better way of doing it... Thoughts?
~~Checked commit https://github.com/ManageIQ/polisher/commit/4229defc3fae0ee58090bb42f9db5fb107b0f0bf with rubocop 1 file checked, 3 offenses detected~~