title: Ruby sort array on condition in reverse order
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2642182/sorting-an-array-in-descending-order-in-ruby">Sorting an array in descending order in Ruby</a>  </p>
  </blockquote>
  
  
  
  <p>I want to sort an array of elements based on some condition, except in reverse order. So basically whatever it would have done and then reversed.</p>
  
  <p>So for example I have an array of strings and I want to sort it by decreasing string length</p>
  
  <pre><code>a = ["test", "test2", "s"]
  a.sort_by!{|str| str.length}.reverse!
  </code></pre>
  
  <p>While this does the job...is there a way to specify the condition such that the sorting algorithm will do it in reverse?</p>