Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 33 lines (25 sloc) 0.552 kb
2204bbc8 »
2010-02-12 Initial public checkin.
1 #!/usr/bin/env ruby
2 # -*- ruby -*-
3
4 usage "--", "Print the last value"
5 def __
6 p IRB.CurrentContext.last_value
7 IRB.CurrentContext.echo ? nil : IRB.CurrentContext.last_value
8 end
9
10 def set_echo_mode(is_echo)
11 if IRB.CurrentContext && IRB.CurrentContext.respond_to?(:echo)
12 IRB.CurrentContext.echo = is_echo
13 else
14 IRB.conf[:ECHO] = is_echo
15 end
16 end
17
18 def quiet
19 set_echo_mode(false)
20 end
21
22 def not_quiet
23 set_echo_mode(true)
24 end
25
26 usage "q", "Enter 'quiet' mode."
27 alias q quiet
28
29 usage "nq", "Exit 'quiet' mode."
30 alias nq not_quiet
31
32 not_quiet
Something went wrong with that request. Please try again.