Friday, August 17, 2007

Turning off echo in the Ruby console

Finally found the info, so keeping it here for the record:

In .irbc:


module IRB
def self.echo_format
conf[:PROMPT][conf[:PROMPT_MODE]][:RETURN]
end

def self.echo_format=(str)
echo_format.replace(str)
end

def self.echo_on
self.echo_format = "=> %s\n"
end

def self.echo_off
self.echo_format = ''
end
end


Then in the console:


>> IRB.echo_off

No comments: