"Patrick Gundlach" <clr1.10.randomuser / spamgourmet.com> schrieb im
Newsbeitrag news:m2r7yd1cbl.fsf / levana.de...
> Hello out there,
>
> I have the following code to sort an array:
>
> def Myclass
>   def sort
>     # $= =false => case sensitive
>     oldequal=$=
>     $= =1
>     @allcmds.sort!
>     $= =oldequal
>   end
> end
>
> And ruby 1.8.1 gives me a warning, that setting $= is deprecated. How
> should I rather do the case insensitive sort?
>
> Patrick

class Myclass
  def sort
    @allcmds.sort! {|a,b| a.casecmp b}
  end
end

    robert