From: matt@... (matt neuburg) Date: 2009-04-04T02:59:33+09:00 Subject: Re: ri is suddenly empty Fernando Perez wrote: > Hi, > > I don't understand what happened: today I wanted to look up for: ri > Array#unshift, and it had nothing: > > Enter the method name you want to look up. > You can use tab to autocomplete. > Enter a blank line to exit. > > >> > > > I tried other classes, and now I always get this error message. How to > fix that? Oooh, oooh, call on me teacher, call on me, I know I know. It's because you've defined an alias of "ri"; it now stands for "ri -i". When "ri" stands for "ri -i", it ignores the argument that follows. Instead, it presents the ">>" prompt, and *now* you can type the name of what you want to look up. So: Big-iMac-Attack:~ mattneub$ ri -i Enter the method name you want to look up. You can use tab to autocomplete. Enter a blank line to exit. >> Array#unshift ---------------------------------------------------------- Array#unshift array.unshift(obj, ...) -> array From Ruby 1.8 ------------------------------------------------------------------------ Prepends objects to the front of array. other elements up one. a = [ "b", "c", "d" ] a.unshift("a") #=> ["a", "b", "c", "d"] a.unshift(1, 2) #=> [ 1, 2, "a", "b", "c", "d"] >> Big-iMac-Attack:~ mattneub$ Notice the blank line at the end (I hit Return) in order to get out of interactive mode. m. -- matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/ Leopard - http://www.takecontrolbooks.com/leopard-customizing.html AppleScript - http://www.amazon.com/gp/product/0596102119 Read TidBITS! It's free and smart. http://www.tidbits.com