This is an easy class for displaying the results of a javascript delivering API.   require ‘json’ require ‘open-uri’   module Search extend self   BASE_URI = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q="   def results(query) results = response_data(query) results["responseData"]["results"].each do |node| puts node["titleNoFormatting"] + ":\n" + node["url"] end end   def response_data(query) data = open( BASE_URI + URI.escape(query), "Referer" => "http://brettu.com" ).read JSON.parse(data) end   end   Search.results("Daily Ruby Tips") Running the file will spit out the following. Ruby Inside: The Ruby Blog: http://www.rubyinside.com/ ScottPreston.Com – Ruby Tip of The Day – Variable Scope | The …: http://www.scottpreston.com/articles/495.php What is the best way to learn Ruby? – Stack Overflow: http://stackoverflow.com/questions/6806/what-is-the-best-way-to-learn-ruby Why Ruby is My Favorite Language – Daily Vim: http://dailyvim.blogspot.com/2008/10/why-ruby-is-my-favorite-language.html This is an easy[…]

Typically from Rails console model actions are the name of the game. There is however the possibility to view the routing of your application.   >> app.url_for :action => ‘index’, :controller =>’posts’ => "http://www.example.com/posts"   >> include Rails.application.routes.url_helpers => Object   >> new_post_path => "/posts/new"

Support for Tk comes built into Ruby. You will need to have Tk installed on your system. The following is an example to create a quick GUI. This is from the Pickaxe book, but I will expand the example next into a useful program. 1) Create a Ruby file with the following. require ‘tk’ root = TkRoot.new { title "A Ruby Powered GUI" } TkLabel.new(root) { text ‘Next we’ll expand this’ pack { padx 15 ; pady 15; side ‘left’ } } Tk.mainloop Running the file will display the following text, “Next we’ll expand this” in a GUI window. :)