The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Screencast Of Argument Autocompletion for Methods in Irb

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Gabriel Horner

Posts: 62
Nickname: cldwaker
Registered: Feb, 2009

Gabriel Horner is an independent consultant who can't get enough of Ruby
Screencast Of Argument Autocompletion for Methods in Irb Posted: May 7, 2010 3:28 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Gabriel Horner.
Original Post: Screencast Of Argument Autocompletion for Methods in Irb
Feed Title: Tagaholic
Feed URL: http://feeds2.feedburner.com/tagaholic
Feed Description: My ruby/rails/knowledge management thoughts
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Gabriel Horner
Latest Posts From Tagaholic

Advertisement

Bond, a gem to improve irb’s autocompletion, just hit version 0.2.0. With this version comes a completion configuration system similar to bash/zsh, more fixes to irb’s incorrect completions and most importantly, any method can have its arguments autocompleted! The screencast demonstrates most of this.

Screencast

Bond – Argument Autocompletion for Methods in Irb from cldwalker.

Screencast Notes

  • Bond.list_methods: Lists all methods (80+) that have argument autocompletion.
  • Examples of methods with argument completion: Kernel#require, Array#delete, Hash#[], Module#const_get, Object#instance_variable_get
  • Object#send: Exemplifies an argument completion that varies per argument. Can be used to invoke argument completions for private methods.
  • Rails examples: ActiveRecord::Base.attr_accessible, ActiveRecord::Base.create, ActiveRecord::Base.where, ActiveRecord::Base.all
  • Basic argument completion example: Bond.complete(:method=>"Array#jump") { %w{foo bar baz} }

Install

Install the gem with:

    sudo gem install bond

In your irbrc, replace irb’s completion (require ‘irb/completion’) with :

  require 'bond'
  Bond.start
  #Bond.start replaces require 'bond/completion' from previous bond versions

If using wirble, place the above after wirble.

Further Reading

Read: Screencast Of Argument Autocompletion for Methods in Irb

Topic: A Typical Day with Git Previous Topic   Next Topic Topic: IO.writev for Ruby

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use