irby 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/irby.rb +22 -6
  3. metadata +2 -3
  4. data/test.rb +0 -9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
data/lib/irby.rb CHANGED
@@ -1,11 +1,27 @@
1
- module Kernel
2
- def irb
3
- require 'irb'
4
- IRB.setup(nil)
5
- irb = IRB::Irb.new(IRB::WorkSpace.new(binding))
6
- IRB.conf[:MAIN_CONTEXT] = irb.context
1
+ require 'irb'
2
+
3
+ module IRB
4
+ def self.start_session(binding)
5
+ unless @__irb_initialized
6
+ IRB.setup(nil)
7
+ @__irb_initialized = true
8
+ end
9
+
10
+ workspace = WorkSpace.new(binding)
11
+
12
+ irb = Irb.new(workspace)
13
+
14
+ @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
15
+ @CONF[:MAIN_CONTEXT] = irb.context
16
+
7
17
  catch(:IRB_EXIT) do
8
18
  irb.eval_input
9
19
  end
10
20
  end
11
21
  end
22
+
23
+ module Kernel
24
+ def irb
25
+ IRB.start_session(binding)
26
+ end
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jugyo
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-13 00:00:00 +09:00
12
+ date: 2010-01-14 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -28,7 +28,6 @@ files:
28
28
  - Rakefile
29
29
  - VERSION
30
30
  - lib/irby.rb
31
- - test.rb
32
31
  has_rdoc: true
33
32
  homepage: http://github.com/jugyo/irby
34
33
  licenses: []
data/test.rb DELETED
@@ -1,9 +0,0 @@
1
- require 'irby'
2
-
3
- class Foo
4
- def bar
5
- irb
6
- end
7
- end
8
-
9
- Foo.new.bar