Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Extract Table Printing Logic #167

Merged
merged 5 commits into from
Sep 24, 2014
Merged

Extract Table Printing Logic #167

merged 5 commits into from
Sep 24, 2014

Conversation

danielsdeleo
Copy link
Contributor

Moves repeated table print logic into a class. Also moves the report classes for policyfile install and upload to their own part of the file hierarchy (and namespace), and adds tests for them.

/cc @opscode/client-engineers

@ui = ui
@column_widths = []

yield self
Copy link

Choose a reason for hiding this comment

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

whoa -- how is the caller using this?

@lamont-granquist
Copy link
Contributor

👍 overall

@danielsdeleo danielsdeleo merged commit 7c4f55c into master Sep 24, 2014
@danielsdeleo danielsdeleo deleted the dry-table-print branch September 24, 2014 23:15
row = ""
cells.each_with_index do |cell_data, i|
row << cell_data.to_s.ljust(@column_widths[i])
row << " "
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be personal preference, but when printing tables I think a tab (two spaces) between columns makes it more readable. Otherwise the row with the longest values in each column starts to read like a sentence.

@tyler-ball
Copy link
Contributor

Great refactor!

ksubrama pushed a commit that referenced this pull request Jan 11, 2016
Disable gem install berkshelf during builds since it's not used anymore.
@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants