[ditz-talk] [PATCH] make 'ditz status' align its output
Nicolas Pouillard
nicolas.pouillard at gmail.com
Sun Apr 27 05:47:20 EDT 2008
Excerpts from William Morgan's message of Sun Apr 27 08:46:43 +0200 2008:
> Column alignment was broken with the introduction of tasks. I also removed
> the percentages because typical output is getting a little too wide for an
> 80-char screen.
> ---
> lib/operator.rb | 56 +++++++++++++++++++++++++++++++++++++++---------------
> 1 files changed, 40 insertions(+), 16 deletions(-)
>
> diff --git a/lib/operator.rb b/lib/operator.rb
> index eb42af9..0ce61f4 100644
> --- a/lib/operator.rb
> +++ b/lib/operator.rb
> @@ -172,19 +172,32 @@ EOS
>
[...]
> - middle = groups.map do |(t,g,nc,pc)|
> - "%2d/%2d (%3.0f%%) %s" % [nc, g.size, pc, t.to_s.pluralize(g.size,
> false)]
Have you an idea of who wrapped this line? I don't think it's mine, and its
in the raw message too.
> + entries.each do |title, middle, bar|
> + printf "%#{title_size}-s ", title
Are you sure of the syntax "%42-s"? It seems to be rejected, you perhaps
meant "%-42s"? If so I can change it my self.
> + middle.zip(middle_sizes).each_with_index do |(e, s), i|
> + sep = i < middle.size - 1 ? "," : ""
> + printf "%#{s + sep.length}-s ", e + sep
Same thing...
--
Nicolas Pouillard aka Ertai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/ditz-talk/attachments/20080427/a9005ac6/attachment.bin>
More information about the ditz-talk
mailing list