irb_drop 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
  -----------
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "irb_drop"
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
  s.authors = "AWD Schweiz"
7
7
  s.homepage = "https://github.com/apeiros/irb_drop"
8
8
 
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irb_drop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: