irb_drop 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +9 -0
- data/irb_drop.gemspec +1 -1
- data/lib/irb_drop.rb +1 -3
- metadata +1 -1
data/README.markdown
CHANGED
@@ -20,6 +20,15 @@ Anywhere in your code, you can just place
|
|
20
20
|
|
21
21
|
That will drop you into an irb session right there.
|
22
22
|
|
23
|
+
Full example:
|
24
|
+
|
25
|
+
require 'irb_drop'
|
26
|
+
x = 1
|
27
|
+
puts "before drop, x is now: #{x}"
|
28
|
+
binding.irb_drop # <-- irb shell starts here, assign something to x, exit from irb
|
29
|
+
# with `exit`
|
30
|
+
puts "after drop, x is now: #{x}"
|
31
|
+
|
23
32
|
|
24
33
|
Description
|
25
34
|
-----------
|
data/irb_drop.gemspec
CHANGED
data/lib/irb_drop.rb
CHANGED
@@ -10,12 +10,10 @@ module Kernel
|
|
10
10
|
# irb_drop(binding)
|
11
11
|
def irb_drop(context=nil, *argv)
|
12
12
|
require 'irb'
|
13
|
-
require 'pp'
|
14
|
-
require 'yaml'
|
15
13
|
restore_trap = false
|
16
14
|
old_trap = nil
|
17
15
|
original_argv = ARGV.dup
|
18
|
-
ARGV.replace(argv) # IRB is being stupid
|
16
|
+
ARGV.replace(argv) # IRB is being stupid (it processes ARGV, destroying it in the process)
|
19
17
|
unless defined? ::IRB_SETUP
|
20
18
|
IRB.setup(nil)
|
21
19
|
Object.const_set(:IRB_SETUP, true)
|