ripl 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ == 0.3.4
2
+ * Rescue failure while printing result
3
+
1
4
  == 0.3.3
2
5
  * Warn about unused arguments
3
6
 
@@ -157,6 +157,7 @@ see {ripl-rails}[http://github.com/cldwalker/ripl-rails].
157
157
  == Ripl Plugins
158
158
 
159
159
  * {ripl-multi_line}[http://github.com/janlelis/ripl-multi_line] : evaluate multiple lines
160
+ * {ripl-ripper}[http://github.com/cldwalker/ripl-ripper] : evaluate multiple lines with ripper
160
161
  * {ripl-rails}[http://github.com/cldwalker/ripl-rails] : console for rails
161
162
  * {ripl-rack}[http://github.com/cldwalker/ripl-rack] : console for rack
162
163
  * {ripl-play}[http://github.com/cldwalker/ripl-play] : play back and record input into ripl
@@ -103,6 +103,8 @@ class Ripl::Shell
103
103
  # Prints result using #format_result
104
104
  def print_result(result)
105
105
  puts(format_result(result)) unless @error_raised
106
+ rescue StandardError, SyntaxError
107
+ warn "ripl: Error while printing result:\n"+ format_error($!)
106
108
  end
107
109
 
108
110
  # Formats errors raised by eval of user input
@@ -1,3 +1,3 @@
1
1
  module Ripl
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
@@ -40,7 +40,15 @@ describe "Shell" do
40
40
  capture_stdout { shell.loop_once }.should == %[=> "mm"\n]
41
41
  end
42
42
 
43
- it "prints error" do
43
+ it "prints error from a failed result" do
44
+ mock(shell).get_input {
45
+ "obj = Object.new; def obj.inspect; raise 'BOOM'; end; obj"
46
+ }
47
+ capture_stderr { shell.loop_once }.
48
+ should =~ /ripl: Error while printing result.*BOOM/m
49
+ end
50
+
51
+ it "prints error from eval" do
44
52
  mock(shell).get_input { "raise 'blah'" }
45
53
  capture_stderr {
46
54
  capture_stdout { shell.loop_once }.should == ""
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripl
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 3
10
- version: 0.3.3
9
+ - 4
10
+ version: 0.3.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gabriel Horner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-26 00:00:00 -04:00
18
+ date: 2011-03-30 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency