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

[Review] Request from 'aduffeck' @ 'SUSE/machinery/review_150701_improve_compare_output' #1061

Merged
merged 10 commits into from Jul 2, 2015

Conversation

aduffeck
Copy link
Contributor

@aduffeck aduffeck commented Jul 1, 2015

Please review the following changes:

  • e45b437 Adapt tests
  • c55960c Refactor Renderer#render_comparison to take a Comparison::Result
  • 8b37797 Add Changelog entry for display of changed packages
  • 7058827 Render changed packages separately in PackagesRenderer
  • c666370 Refactor Renderer API
  • d42ba6d Change #compare_with methods to return forth element (changed elements)
  • e670a32 Add Comparison which encapsulates comparisons of system descriptions

@@ -36,7 +42,7 @@ class BarBazScope < Machinery::Object
end

class BarBazRenderer < Renderer
def do_render
def content(description)

Choose a reason for hiding this comment

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

Unused method argument - description. If it's necessary, use _ or _description as an argument name to indicate that it won't be used. You can also write as content(*) if you want the method to accept any arguments but don't care about them.

Comparison#compare_scope returns a Comparison::result which can be used
like that:

comparison.name1 # name of description 1
comparison.name2 # name of description 2
comparison.only_in1 # partial scope of data only in description 1
comparison.only_in2 # partial scope of data only in description 2
comparison.changed  # elements in both with changed attributes
comparison.common   # partial scope of data in both descriptions
comparison.as_description(:one) # methods for returning the according
comparison.as_description(:two) # data wrapped into a SystemDescription
comparison.as_description(:common)
There is now a well defined set of "content*" methods that are supposed to
be overriden in the subclasses. That makes the separation of the
responsibilities clearer.
@aduffeck aduffeck force-pushed the review_150701_improve_compare_output branch from e45b437 to 7f97b2c Compare July 1, 2015 13:40
# you may find current contact information at www.suse.com

class Comparison
class Result
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this inner class really needed? Couldn't the Comparison class itself have all the methods?

@aduffeck aduffeck force-pushed the review_150701_improve_compare_output branch from b8b2bbb to 4cd6a68 Compare July 2, 2015 08:48
@cornelius
Copy link
Contributor

lgtm

aduffeck added a commit that referenced this pull request Jul 2, 2015
[Review] Request from 'aduffeck' @ 'SUSE/machinery/review_150701_improve_compare_output'
@aduffeck aduffeck merged commit 56f38f5 into master Jul 2, 2015
@aduffeck aduffeck deleted the review_150701_improve_compare_output branch July 2, 2015 11:50
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

3 participants