new to ruby

I

Imraan Moolla

why does my while loop never end?

puts 'Please enter a number:'
number = gets.chomp.to_i
while number != ''
if number > 0
puts 'You have entered a number greater than 0'
end
puts 'Please enter a number'
number = gets.chomp.to_i
end
puts 'Goodbye!'
 
P

Peña, Botp

RnJvbTogSW1yYWFuIE1vb2xsYSBbbWFpbHRvOmltb29sbGFAZ21haWwuY29tXSANCiMgd2h5IGRv
ZXMgbXkgd2hpbGUgbG9vcCBuZXZlciBlbmQ/DQoNCmNoZWNrIHlvdXIgd2hpbGUgY29uZGl0aW9u
LCBwbHMuDQogDQojIHB1dHMgJ1BsZWFzZSBlbnRlciBhIG51bWJlcjonDQojIG51bWJlciA9IGdl
dHMuY2hvbXAudG9faQ0KDQpudW1iZXIgaXMgYW4gaW50ZWdlcg0KDQojIHdoaWxlIG51bWJlciAh
PSAnJw0KDQp0aGVuIHlvdSdyZSBjb21wYXJpbmcgaXQgdyBhIHN0cmluZw0K
 
T

Thind, Aman

Hello,

Is there any other source where I could download the gem
activerecord-sybase-adapter.

I have been trying to access http://gems.rubyonrails.org all day, which
hosts these adapters according to
http://weblog.rubyonrails.org/2007/10/1/adapter-gems-available but to no
avail.

http://gems.rubyforge.net didn't yield anything either.

I am upgrading to rails 2.0 and this is holding me back.

Many Thanks,
Aman



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - =
- - - - - - -

This message is intended only for the personal and confidential use of the =
designated recipient(s) named above. If you are not the intended =
recipient of this message you are hereby notified that any review, =
dissemination, distribution or copying of this message is strictly =
prohibited. This communication is for information purposes only and =
should not be regarded as an offer to sell or as a solicitation of an =
offer to buy any financial product, an official confirmation of any =
transaction, or as an official statement of Lehman Brothers. Email =
transmission cannot be guaranteed to be secure or error-free. Therefore, =
we do not represent that this information is complete or accurate and it =
should not be relied upon as such. All information is subject to change =
without notice.
 
C

Codeblogger

Note: parts of this message were removed by the gateway to make it a legal Usenet post.

Because gets.chomp.to_i will never be an empty string ('').

''.to_i
--> 0

nil.to_i
--> 0

Regards,
Nicolai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,274
Messages
2,571,365
Members
48,048
Latest member
Carson62C3

Latest Threads

Top