Search code examples
rubyshoes

How to right align an array of numbers in Ruby Shoes?


Tried align: right and sprintf, but for some reason it does not do a right alignment.

[ 50, 100, 50 ]

 50
100
 50

Is this a limitation of Shoes 4?


Solution

  • I tested this with green shoes since i don't use Shoes4 but it should be the same.

    Shoes.app do
      flow do
        [ 50, 100, 50 ].each do |number|
          para number, :align => 'right'
        end
      end
    end