rib 1.0.3 → 1.0.4
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/.travis.yml +2 -1
- data/CHANGES.md +11 -0
- data/README.md +1 -1
- data/TODO.md +2 -0
- data/lib/rib/core/multiline.rb +11 -1
- data/lib/rib/core/strip_backtrace.rb +1 -1
- data/lib/rib/runner.rb +9 -0
- data/lib/rib/test/multiline.rb +49 -0
- data/lib/rib/version.rb +1 -1
- data/rib.gemspec +3 -3
- data/task/gemgem.rb +1 -1
- metadata +4 -3
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# CHANGES
|
2
2
|
|
3
|
+
## Rib 1.0.4 -- 2012-03-20
|
4
|
+
|
5
|
+
* [core/multiline] Fixed a corner case:
|
6
|
+
|
7
|
+
``` ruby
|
8
|
+
1/1.to_i +
|
9
|
+
1
|
10
|
+
```
|
11
|
+
|
12
|
+
* [rib] Do not crash because of a loop error. Try to relaunch the shell.
|
13
|
+
|
3
14
|
## Rib 1.0.3 -- 2012-01-21
|
4
15
|
|
5
16
|
### Bugs fixes
|
data/README.md
CHANGED
@@ -224,7 +224,7 @@ simple, simpler than rib-rails.
|
|
224
224
|
|
225
225
|
Apache License 2.0
|
226
226
|
|
227
|
-
Copyright (c) 2011, Lin Jen-Shin (godfat)
|
227
|
+
Copyright (c) 2011-2012, Lin Jen-Shin (godfat)
|
228
228
|
|
229
229
|
Licensed under the Apache License, Version 2.0 (the "License");
|
230
230
|
you may not use this file except in compliance with the License.
|
data/TODO.md
CHANGED
data/lib/rib/core/multiline.rb
CHANGED
@@ -21,12 +21,22 @@ module Rib::Multiline
|
|
21
21
|
# ruby -e 'class C'
|
22
22
|
# ruby -e 'def f'
|
23
23
|
# ruby -e 'begin'
|
24
|
+
# ruby -e 'eval "1+1.to_i +"'
|
25
|
+
# ruby -e 'eval "1+1.to_i -"'
|
26
|
+
# ruby -e 'eval "1+1.to_i *"'
|
27
|
+
# ruby -e 'eval "1+1.to_i /"'
|
28
|
+
# ruby -e 'eval "1+1.to_i &"'
|
29
|
+
# ruby -e 'eval "1+1.to_i |"'
|
30
|
+
# ruby -e 'eval "1+1.to_i ^"'
|
31
|
+
BINARY_OP = %w[tUPLUS tUMINUS tSTAR tREGEXP_BEG tAMPER]
|
24
32
|
ERROR_REGEXP = case engine
|
25
33
|
when 'ruby' ; Regexp.new(
|
26
34
|
[ # string or regexp
|
27
35
|
"unterminated \\w+ meets end of file",
|
28
36
|
# mri and rubinius
|
29
|
-
"syntax error, unexpected \\$end"
|
37
|
+
"syntax error, unexpected \\$end" ,
|
38
|
+
"unexpected (#{BINARY_OP.join('|')}), expecting \\$end"
|
39
|
+
].join('|'))
|
30
40
|
when 'rbx' ; Regexp.new(
|
31
41
|
[ # string or regexp
|
32
42
|
"unterminated \\w+ meets end of file",
|
@@ -7,7 +7,7 @@ module Rib::StripBacktrace
|
|
7
7
|
|
8
8
|
# --------------- Rib API ---------------
|
9
9
|
|
10
|
-
# strip backtrace until
|
10
|
+
# strip backtrace until rib
|
11
11
|
def format_error err
|
12
12
|
return super if StripBacktrace.disabled?
|
13
13
|
message, backtrace = get_error(err, strip_backtrace(err))
|
data/lib/rib/runner.rb
CHANGED
@@ -73,7 +73,16 @@ module Rib::Runner
|
|
73
73
|
# not any other Rib command
|
74
74
|
Rib.warn("Unused arguments: #{unused.inspect}") unless unused.empty?
|
75
75
|
require 'rib/core' if Rib.config.delete(:mimic_irb)
|
76
|
+
loop
|
77
|
+
end
|
78
|
+
|
79
|
+
def loop
|
76
80
|
Rib.shell.loop
|
81
|
+
rescue Exception
|
82
|
+
Rib.warn("Relaunching a new shell...")
|
83
|
+
Rib.shells.pop
|
84
|
+
Rib.shells << Rib::Shell.new(Rib.config)
|
85
|
+
retry
|
77
86
|
end
|
78
87
|
|
79
88
|
def parse argv
|
data/lib/rib/test/multiline.rb
CHANGED
@@ -137,4 +137,53 @@ shared :multiline do
|
|
137
137
|
s-y n
|
138
138
|
RUBY
|
139
139
|
end
|
140
|
+
|
141
|
+
should 'binary operator +' do
|
142
|
+
check <<-RUBY
|
143
|
+
1/1.to_i +
|
144
|
+
1
|
145
|
+
RUBY
|
146
|
+
end
|
147
|
+
|
148
|
+
should 'binary operator -' do
|
149
|
+
check <<-RUBY
|
150
|
+
1*1.to_i -
|
151
|
+
1
|
152
|
+
RUBY
|
153
|
+
end
|
154
|
+
|
155
|
+
should 'binary operator *' do
|
156
|
+
check <<-RUBY
|
157
|
+
1-1.to_i *
|
158
|
+
1
|
159
|
+
RUBY
|
160
|
+
end
|
161
|
+
|
162
|
+
should 'binary operator /' do
|
163
|
+
check <<-RUBY
|
164
|
+
1+1.to_i /
|
165
|
+
1
|
166
|
+
RUBY
|
167
|
+
end
|
168
|
+
|
169
|
+
should 'binary operator |' do
|
170
|
+
check <<-RUBY
|
171
|
+
1+1.to_i |
|
172
|
+
1
|
173
|
+
RUBY
|
174
|
+
end
|
175
|
+
|
176
|
+
should 'binary operator &' do
|
177
|
+
check <<-RUBY
|
178
|
+
1+1.to_i &
|
179
|
+
1
|
180
|
+
RUBY
|
181
|
+
end
|
182
|
+
|
183
|
+
should 'binary operator ^' do
|
184
|
+
check <<-RUBY
|
185
|
+
1+1.to_i ^
|
186
|
+
1
|
187
|
+
RUBY
|
188
|
+
end
|
140
189
|
end
|
data/lib/rib/version.rb
CHANGED
data/rib.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "rib"
|
5
|
-
s.version = "1.0.
|
5
|
+
s.version = "1.0.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Lin Jen-Shin (godfat)"]
|
9
|
-
s.date = "2012-
|
9
|
+
s.date = "2012-03-20"
|
10
10
|
s.description = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell\n\nRib is based on the design of [ripl][] and the work of [ripl-rc][], some of\nthe features are also inspired by [pry][]. The aim of Rib is to be fully\nfeatured and yet very easy to opt-out or opt-in other features. It shall\nbe simple, lightweight and modular so that everyone could customize Rib.\n\n[ripl]: https://github.com/cldwalker/ripl\n[ripl-rc]: https://github.com/godfat/ripl-rc\n[pry]: https://github.com/pry/pry"
|
11
11
|
s.email = ["godfat (XD) godfat.org"]
|
12
12
|
s.executables = [
|
@@ -80,7 +80,7 @@ Gem::Specification.new do |s|
|
|
80
80
|
"test/test_shell.rb"]
|
81
81
|
s.homepage = "https://github.com/godfat/rib"
|
82
82
|
s.require_paths = ["lib"]
|
83
|
-
s.rubygems_version = "1.8.
|
83
|
+
s.rubygems_version = "1.8.19"
|
84
84
|
s.summary = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell"
|
85
85
|
s.test_files = [
|
86
86
|
"test/core/test_completion.rb",
|
data/task/gemgem.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-20 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! 'Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
|
15
15
|
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 1.8.
|
124
|
+
rubygems_version: 1.8.19
|
125
125
|
signing_key:
|
126
126
|
specification_version: 3
|
127
127
|
summary: Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
|
@@ -137,3 +137,4 @@ test_files:
|
|
137
137
|
- test/test_api.rb
|
138
138
|
- test/test_plugin.rb
|
139
139
|
- test/test_shell.rb
|
140
|
+
has_rdoc:
|