rib 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,4 +5,5 @@ rvm:
5
5
  - 1.9.3
6
6
  - rbx-18mode
7
7
  - rbx-19mode
8
- - jruby
8
+ - jruby-18mode
9
+ - jruby-19mode
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
@@ -1,5 +1,7 @@
1
1
  # TODO
2
2
 
3
+ * Fix whenever Color.enabled? but StripBacktrace.disabled?
4
+
3
5
  * Runner tests
4
6
  * Documentation
5
7
  * Implement exception_spy
@@ -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"] .join('|'))
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 ripl
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))
@@ -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
@@ -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
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Rib
3
- VERSION = '1.0.3'
3
+ VERSION = '1.0.4'
4
4
  end
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rib"
5
- s.version = "1.0.3"
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-01-21"
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.15"
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",
@@ -113,7 +113,7 @@ module Gemgem
113
113
 
114
114
  def all_files
115
115
  @all_files ||= find_files(Pathname.new(dir)).map{ |file|
116
- if file.to_s =~ %r{\.git/}
116
+ if file.to_s =~ %r{\.git/|\.git$}
117
117
  nil
118
118
  else
119
119
  file.to_s
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.3
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-01-21 00:00:00.000000000 Z
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.15
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: