dietrb 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/dietrb.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dietrb}
8
- s.version = "0.4.3"
8
+ s.version = "0.4.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Eloy Duran"]
data/lib/irb/context.rb CHANGED
@@ -48,6 +48,7 @@ module IRB
48
48
  puts formatter.result(result)
49
49
  result
50
50
  rescue Exception => e
51
+ store_exception(e)
51
52
  puts formatter.exception(e)
52
53
  end
53
54
 
@@ -114,6 +115,10 @@ module IRB
114
115
  def store_result(result)
115
116
  @underscore_assigner.call(result)
116
117
  end
118
+
119
+ def store_exception(exception)
120
+ $e = $EXCEPTION = exception
121
+ end
117
122
  end
118
123
  end
119
124
 
data/lib/irb/version.rb CHANGED
@@ -8,7 +8,7 @@ module IRB
8
8
  module VERSION #:nodoc:
9
9
  MAJOR = 0
10
10
  MINOR = 4
11
- TINY = 3
11
+ TINY = 4
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY].join('.')
14
14
  DESCRIPTION = "#{STRING} (DietRB)"
data/spec/context_spec.rb CHANGED
@@ -112,6 +112,13 @@ describe "IRB::Context, when evaluating source" do
112
112
  }.should.not.raise
113
113
  end
114
114
 
115
+ it "assigns the last raised exception to the global variable `$EXCEPTION' / `$e'" do
116
+ @context.evaluate("DoesNotExist")
117
+ $EXCEPTION.should.be.instance_of NameError
118
+ $EXCEPTION.message.should.include 'DoesNotExist'
119
+ $e.should == $EXCEPTION
120
+ end
121
+
115
122
  it "prints the exception that occurs" do
116
123
  @context.evaluate("DoesNotExist")
117
124
  @context.printed.should.match /^NameError:.+DoesNotExist/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dietrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran