Posted By: Giles Bowkett
Date: 2007-12-13 03:10
Summary: Utility Belt Released: Pimp Your IRB
Project: Utility Belt

Utility Belt was released yesterday. The subject of this news item comes from the Ruby Inside blog post following my own blog post. UB has gone through several dot versions already, due to the combination of lots of visibility and lots of bugs. Yay! It's fun. Actually the gem has a ton of cool features, and a few kinks here and there which are being swiftly ironed out. Current version is 1.0.4.

Latest News
icalendar 1.4.0 Released
    Ryan Ahearn - 2013-05-21 23:17
BinData 1.5.0 - source moved to github
    Dion Mendel - 2013-05-21 11:10
v13.5.0 Released !!
    id 774 - 2013-05-18 12:28
Runt v0.9.0 Released
    Matthew Lipper - 2013-05-17 00:11
kramdown 1.0.2 released
    Thomas Leitner - 2013-05-09 06:58

 

Forums | Admin

Discussion Forums: utility-belt-released--pimp-your-irb

Start New Thread Start New Thread

 

By: Ed Hickey
RE: a few bugs i found [ reply ]  
2007-12-13 09:51
You're right: version 1.0.4 fixed the blank? issue as well as the user issue.

Makes sense regarding the google command...it works from the command line :)

Thanks for a great gem.

Ed

By: Giles Bowkett
RE: a few bugs i found [ reply ]  
2007-12-13 07:41
Hey Ed.

The blank? bug is fixed in a new version. If you do a gem update you'll have that working.

Also, the google thing only works from the UNIX command line. Not from within IRB. Everybody seems to be getting that wrong, though, literally everybody, so I think I have to improve my documentation. Actually I think I'm going to improve my documentation AND set it up so you can use it from IRB. Best of both worlds that way.

Last but not least, the user thing - that one has me worried. I have no idea what's going on there. It generates its models by doing a dir glob, so it could be that your User model's not in app/models? Seems pretty unlikely but if it were happening somehow that would explain it.

By: Ed Hickey
a few bugs i found [ reply ]  
2007-12-12 16:27
I think you're on the case, but either way:
This doesn't work when in plain irb:
>> grep_classes("ixnum")
NoMethodError: undefined method `blank?' for "IRB::Context":String
from /opt/local/lib/ruby/gems/1.8/gems/utility_belt-1.0.3/lib/language_greps.rb:8:in `grep_classes'
from /opt/local/lib/ruby/gems/1.8/gems/utility_belt-1.0.3/lib/language_greps.rb:8:in `each_object'
from /opt/local/lib/ruby/gems/1.8/gems/utility_belt-1.0.3/lib/language_greps.rb:8:in `grep_classes'
from (irb):20

It works in Rails which I assume is because Object.blank? is a ActionPack method.

Also, in Rails console
user(:all) & user(1) don't work:

>> user(1)
NoMethodError: undefined method `user' for #<Object:0x349a4>
from (irb):15
>> user(:all)
NoMethodError: undefined method `user' for #<Object:0x349a4>
from (irb):16

Regular way works fine:
>> u = User.find(1)
User Load (1) (0.000181) SELECT * FROM users WHERE (users.`id` = 1)
...
=> #<User:0x3216e90 @attributes={"created_on"=>"2006-08-26 12:27:28"...}


Had problems with Google search too:
./script/console version:
>> google "go"
NoMethodError: undefined method `google' for #<Object:0x349a4>
from (irb):3

regular irb:
>> google 'work+please'
NoMethodError: undefined method `google' for main:Object
from (irb):1
from /opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.4.0/lib/aws/s3/bucket.rb:190

Great work overall though. Some really helpful stuff in here!