irb

How Do You Clear The IRB Console?

How do you clear the IRB console screen? ...

What's Your Favourite IRB Trick?

What's your favourite IRB tip or trick? It could be a handy shortcut within the IRB console itself or maybe a .irbrc customization. I really like that you can type an underscore to retrieve the result of the last expression. ...

How to incorporate Interactive Ruby into my development process?

I am trying to find a better way to integrate IRB with my normal ruby devleopment. Currently I rarely use IRB with my code. I only use it to verify syntax or to try something small. I know I can load my own code into ruby as a require 'mycode' but this usually doesn't mesh with my programming style. Sometimes the variables I wan...

Ruby. How can I copy and paste in irb on Windows?

How can I copy and paste in irb (Interactive Ruby Shell) on Windows? ...

How do you list the currently available objects in the current scope in ruby?

I'm new to ruby and I'm playing around with the irb. I found that I can list methods of an object using the ".methods" method, and that self.methods sort of gives me what I want (similar to python's dir(builtins)?), but how can I find the methods of a library/module I've loaded via include and require? irb(main):036:0* self.methods =>...

How do I get the "irb(main):001:0>" prompt instead of ">>"

Hi, Ruby is preinstalled on my Mac and so I wanted to have a look at it. First thing I noticed, is that irb prompts >> instead of irb(main):001:0>. I can't find anything on how to change this with Google because everyone is using irb(main):001:0> in their code ;-) Can you help me out? PS: It's not that I think Ruby is broken, but I wan...

Text editor / IDE for Ruby similar to DrScheme

For those who haven't used DrScheme, window is split in two parts: one part is a file you're editing, and the other is interactive shell. When I run a file, it is loaded into interactive environment, so I can invoke functions I've defined etc. Interactive environment still has all the features of text editor (syntax highlighting, auto co...

Ruby: How to make IRB print structure for Arrays and Hashes

When I make a new array/hash in irb, it prints out a nice format to show the structure, ex. ["value1", "value2", "value3"] {"key1" => "value1"} ... but when I try to print out my variables using puts, I get them collapsed: value1 value2 value3 key1 value1 I gather that puts is not the right command for what I want, but what is? I ...

Ruby console alternative for IRB (Windows)

I am looking for some free light-weight GUI alternative for IRB console on windows. What I whould like to see: Area to write a script (so I can edit, run, edit...) Command line to play with current variables Output window to see results Intellisence Breakpoints/debugging is a plus Actually, some thing similar to powershell_ise.exe wh...

Control IRB through a named pipe (instead of STDIN/STDOUT)

Is it possible to run Ruby IRB ver a named pipe, so I can send commands and get results remotely? Generally I would like to utilize the IRB engine, while have a different UI (probably written with .Net). ...

Where Can I Find Current Adobe Image Format Specifications? "Clipping Paths"

This is in regards to Adobe's Image Resource Blocks(IRB), that they store in TIFF, PSD, JPEG Formats. It's also called "8BIM", This standard was released with Adobe's Photoshop 3 (November 1994). IRB contains information on color profiles and clipping paths(what i am interested in). The only piece of documentation i can find on the int...

drop to irb prompt from ruby

Can I drop to an irb prompt from a ruby script? I want to run a script, but then have it give me an irb prompt at a point in the program with the current state of the program, but not just by running rdebug and having a breakpoint. ...

So maybe I'm not getting the idea in Ruby but I have a question about Enumerables inject.

The |m,k| thing kind of throws me off. Does this have anything to do with order of precedence? m standing for 0 (or 1 in some languages) and k for the last in the Array/Hash whatever? So why do people put a number in .inject()? Alternatively, is there an easy way to learn how to use this, and exactly what it's value is? Judging from th...

How to get nice formatting in the Rails console

I want to get something like this to look nice: >> ProductColor.all => [#<ProductColor id: 1, name: "White", internal_name: "White", created_at: "2009-06-10 04:02:44", updated_at: "2009-06-10 04:02:44">, #<ProductColor id: 2, name: "Ivory", internal_name: "Ivory", created_at: "2009-06-10 04:02:44", updated_at: "2009-06-10 04:02:44">, #<...

How would you go about making an online IRB that runs in the browser

Im wondering how to go about creating an online IRB that runs in the browser. I have an idea to include an irb console in my blog and give the option for users to send code blocks in my tutorials directly into the irb console so they can play around with it. _Why did this previously, but of course it is gone now: Cached Version ...

How to enable auto compleation in Ruby's IRB

When I use Merb's built in console, I get tab auto-completion similar to a standard bash prompt. I find this useful and would like to enable it in non-merb IRB sessions. How do I get auto-completion in IRB? ...

Why does this code produce a nil following a Proc.call?

C:\>irb irb(main):001:0> s = Proc.new { puts "Hello" } => #<Proc:0x04051780@(irb):1> irb(main):002:0> s.call Hello => nil What causes the nil? ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] ...

How come when I run ruby.exe / IRB all I get is a blank DOS shell?

Hi, I installed ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32] on my Windows XP laptop. When I run ruby.exe I get a blank DOS Shell window. No expected "irb(main):001:0>" at the top left of the command prompt. I can type into the shell but, any code I type in actually does anything when pressing enter. I should mention tha...

Can't find gems in irb: "NameError: uninitialized constant Gem from (irb)"

When I run a Rails app it finds all of my installed gems correctly. This is the first time I tried to call some gems from inside irb and it couldn't find them. blocke:~$ irb irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'rails' LoadError: no such file to load -- rails from /usr/local/lib/site_ruby/1.8/rubygems/c...

Ruby Configure IRB to Pretty_Inspect by Default

Hi Guys, I'm fairly new to ruby, and am configuring IRB. I like pretty print (require 'pp'), but it seems a hassle to always type pp for it to pretty print it. What I'd like to do is make it pretty print by default, so if i have a var , say, 'myvar', and type myvar, it automatically calls pretty_inspect instead of the regular inspect...