ripl-multi_line 0.2.0 → 0.2.1
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/CHANGELOG.rdoc +3 -0
- data/lib/ripl/multi_line.rb +13 -2
- metadata +3 -3
data/CHANGELOG.rdoc
CHANGED
data/lib/ripl/multi_line.rb
CHANGED
|
@@ -2,7 +2,17 @@ require 'ripl'
|
|
|
2
2
|
|
|
3
3
|
module Ripl
|
|
4
4
|
module MultiLine
|
|
5
|
-
VERSION = '0.2.
|
|
5
|
+
VERSION = '0.2.1'
|
|
6
|
+
ERROR_REGEXP = /#{
|
|
7
|
+
[ %q%unexpected $end%,
|
|
8
|
+
%q%unterminated string meets end of file%,
|
|
9
|
+
# rubinius
|
|
10
|
+
%q%expecting '\\n' or ';'%,
|
|
11
|
+
%q%missing 'end'%,
|
|
12
|
+
%q%expecting '}'%,
|
|
13
|
+
# jruby
|
|
14
|
+
%q%syntax error, unexpected end-of-file%,
|
|
15
|
+
].map{|e| Regexp.escape(e)}*'|' }/
|
|
6
16
|
|
|
7
17
|
def before_loop
|
|
8
18
|
super
|
|
@@ -21,7 +31,8 @@ module Ripl
|
|
|
21
31
|
end
|
|
22
32
|
|
|
23
33
|
def print_eval_error(e)
|
|
24
|
-
|
|
34
|
+
|
|
35
|
+
if e.is_a?(SyntaxError) && e.message =~ ERROR_REGEXP
|
|
25
36
|
@buffer ||= []
|
|
26
37
|
@buffer << @input
|
|
27
38
|
throw :multiline
|
metadata
CHANGED
|
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
|
5
5
|
segments:
|
|
6
6
|
- 0
|
|
7
7
|
- 2
|
|
8
|
-
-
|
|
9
|
-
version: 0.2.
|
|
8
|
+
- 1
|
|
9
|
+
version: 0.2.1
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Jan Lelis
|
|
@@ -14,7 +14,7 @@ autorequire:
|
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
16
|
|
|
17
|
-
date: 2010-12-
|
|
17
|
+
date: 2010-12-12 00:00:00 +01:00
|
|
18
18
|
default_executable:
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|