From: Rob Biedenharn Date: 2007-07-10T01:42:04+09:00 Subject: Re: Programming habit On Jul 9, 2007, at 12:06 PM, Peter Versteegen wrote: > Thanks for the prompt answer. > > I added the require statements and tried with and without the gems > requirement but it still did not give me the expected out put for > 42., using Tab as a word or as the key stroke. I put a puts > statement in the .irbc file to show that Irb reads that file. > > I get the ?> prompt asking for some other input. > > Any other ideas? > > The q worked just fine. > > Thanks. > > > Pete > -------------------------------------- > pversteegen@gcnetmail.net The first TAB key press beeps at me, then I get: irb(main):004:0> 42. 42.gcd 42.numerator 42.succ 42.__id__ 42.gcdlcm 42.object_id 42.taguri 42.__send__ 42.gem 42.power! 42.taguri= 42.abs 42.hash 42.prec 42.taint 42.between? 42.id 42.prec_f 42.tainted? 42.ceil 42.id2name 42.prec_i 42.times 42.chr 42.inspect 42.private_methods 42.to_a 42.class 42.instance_eval 42.protected_methods 42.to_bn 42.clone 42.instance_of? 42.public_methods 42.to_f 42.coerce 42.instance_variable_get 42.quo 42.to_i 42.denominator 42.instance_variable_set 42.rdiv 42.to_int 42.display 42.instance_variables 42.remainder 42.to_r 42.div 42.integer? 42.require 42.to_s 42.divmod 42.is_a? 42.require_gem 42.to_sym 42.downto 42.kind_of? 42.respond_to? 42.to_yaml 42.dup 42.lcm 42.round 42.to_yaml_properties 42.eql? 42.method 42.rpower 42.to_yaml_style 42.equal? 42.methods 42.send 42.truncate 42.extend 42.modulo 42.singleton_method_added 42.type 42.floor 42.next 42.singleton_methods 42.untaint 42.freeze 42.nil? 42.size 42.upto 42.frozen? 42.nonzero? 42.step 42.zero? irb(main):004:0> 42. I suspect that the confusion comes from the fact that 42._ might be the start of a Float (note the first blank entry at the top of the first column), but in any case, the completion only happens immediately (no bell or list) if the completion is unambiguous. Try typing 42.tiTAB and you should get 42.times_ (at least I do). Mac OS X 10.4.10 $ ruby -v ruby 1.8.5 (2006-08-25) [i686-darwin8.8.1] $ irb --version irb 0.9.5(05/04/13) -Rob > On Jul 9, 2007, at 10:53 AM, Rob Biedenharn wrote: > >> >> On Jul 9, 2007, at 10:35 AM, Peter Versteegen wrote: >> >>> Hi, >>> >>> I'm relatively new to Ruby and haven't programmed in a while and >>> am trying to get back into a good programming habit. >>> >>> In the reference: http://www.caliban.org/ruby/rubyguide.shtml#ri >>> >>> it states that, in irb, if you do 42. you get a list of all >>> the methods that pertain to the class 42, a very useful function, >>> except that it doesn't work on my system (Mac OS 10.4.10, and >>> ruby 1.8.6 and irb 0.9.5(05/04/13) -- Note the date on irb!) >>> >>> Also, when I do ri I get a list that ends with (END). I can't >>> find a clean exit from it (ctrl z seems to be the only thing that >>> works), but it leaves, using ps, a suspended process. >>> >>> How can I cleanup all of this? >>> >>> Thanks. >>> >>> Pete Versteegen >>> ----------------------- >>> pversteegen@gcnetmail.net >> >> Put these lines into a file .irbrc in your home directory >> >> require 'rubygems' >> require 'irb/completion' >> >> You could also just type them into your irb session to try them out. >> >> The "END" in ri's output is actually a prompt from the pager >> "less" (in all likelihood if you've not changed it). You should >> be able to get out with 'q'. See `man less` or type 'h' instead >> of 'q'. You can also tell ri to send output directly rather than >> through a pager like less with a '-T' option, for example: ri -T >> File.exist? >> >> -Rob >> >> Rob Biedenharn http://agileconsultingllc.com >> Rob@AgileConsultingLLC.com >> >> >> >> > Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com +1 513-295-4739 Skype: rob.biedenharn