rib 1.1.2 → 1.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: ed9203a2c38b4c5f777050704e017e59a3a0c3d4
4
- data.tar.gz: c95415a6ffceb31192b831cdf40ca0c65160372d
5
- !binary "U0hBNTEy":
6
- metadata.gz: b8a716e4add8d185fc974694242db2a3284f23d4767c8e0b1180483923fcbf49fe7314c8a9a702da109d2d211da117afb0b0158077d811eae29cc2e9dc46ce8b
7
- data.tar.gz: 44d81172d658cc298dca38c756ef25c3c08817beecad80eedcc4cb702df53683f71cea2e90b3eae8a5ad929547eaf69db060510c6a150656d7d875a8b4ae33da
2
+ SHA1:
3
+ metadata.gz: f9c0da1c91b42793b8e4383b923c4a10f127d11a
4
+ data.tar.gz: 9bc65bd697acdd2bd8639a490a059d46a7099c1b
5
+ SHA512:
6
+ metadata.gz: 1246de926465360d9179a61d703c8b53d2ff4df11d9ba9bbd1b6df4457d62c670b4af3ef3b6b4492e565c89b0e66a071e3f38005bdc37b6c59cb9512ba072161
7
+ data.tar.gz: d2ba9ba0d7b1944fd82558b574655687af2137ce261845e69d8e1130cadf2bc897e0313673376fe9e6810089c8f67ccb3336deeaa38ebdc059968a840d06d438
data/.travis.yml CHANGED
@@ -5,7 +5,7 @@ env:
5
5
  - 'RBXOPT=-X19'
6
6
 
7
7
  rvm:
8
- - 1.9.2
9
8
  - 1.9.3
9
+ - 2.0.0
10
10
  - rbx-head
11
11
  - jruby-head
data/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGES
2
2
 
3
+ ## Rib 1.1.3 -- 2013-05-08
4
+
5
+ * Fixed a bug where if user input doesn't respond to `==` would crash rib.
6
+
3
7
  ## Rib 1.1.2 -- 2013-04-02
4
8
 
5
9
  * [core/multiline] Ruby 2.0 compatibility.
data/lib/rib/api.rb CHANGED
@@ -41,7 +41,7 @@ module Rib::API
41
41
  result, err = eval_input(input)
42
42
  if err
43
43
  print_eval_error(err)
44
- elsif input.strip != '' && result != Rib::Skip
44
+ elsif input.strip != ''
45
45
  print_result(result)
46
46
  else
47
47
  # print nothing for blank input
@@ -79,7 +79,7 @@ module Rib::API
79
79
 
80
80
  # Print result using #format_result
81
81
  def print_result result
82
- puts(format_result(result))
82
+ puts(format_result(result)) if result != Rib::Skip
83
83
  rescue StandardError, SyntaxError => e
84
84
  Rib.warn("Error while printing result:\n #{format_error(e)}")
85
85
  end
data/lib/rib/test.rb CHANGED
@@ -85,3 +85,8 @@ module Kernel
85
85
  self == rhs
86
86
  end
87
87
  end
88
+
89
+ Rib::Blackhole = Object.new
90
+ b = Rib::Blackhole.singleton_class
91
+ b.instance_methods(true).each{ |m|
92
+ b.send(:undef_method, m) unless [:object_id, :__send__].include?(m) }
data/lib/rib/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Rib
3
- VERSION = '1.1.2'
3
+ VERSION = '1.1.3'
4
4
  end
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.1.2"
5
+ s.version = "1.1.3"
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 = "2013-04-02"
9
+ s.date = "2013-05-08"
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,8 +80,9 @@ Gem::Specification.new do |s|
80
80
  "test/test_plugin.rb",
81
81
  "test/test_shell.rb"]
82
82
  s.homepage = "https://github.com/godfat/rib"
83
+ s.licenses = ["Apache License 2.0"]
83
84
  s.require_paths = ["lib"]
84
- s.rubygems_version = "2.0.0"
85
+ s.rubygems_version = "2.0.3"
85
86
  s.summary = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell"
86
87
  s.test_files = [
87
88
  "test/core/test_completion.rb",
data/task/gemgem.rb CHANGED
@@ -14,6 +14,7 @@ module Gemgem
14
14
 
15
15
  s.description = description.join
16
16
  s.summary = description.first
17
+ s.license = readme['LICENSE'].sub(/.+\n\n/, '').lines.first.strip
17
18
 
18
19
  s.rubygems_version = Gem::VERSION
19
20
  s.date = Time.now.strftime('%Y-%m-%d')
@@ -33,8 +34,8 @@ module Gemgem
33
34
  @readme ||=
34
35
  if path
35
36
  ps = "##{File.read(path)}".
36
- scan(/((#+)[^\n]+\n\n.+?(?=\n\n\2[^#\n]+\n))/m).map(&:first)
37
- ps.inject({'HEADER' => ps.first}){ |r, s, i|
37
+ scan(/((#+)[^\n]+\n\n.+?(?=(\n\n\2[^#\n]+\n)|\Z))/m).map(&:first)
38
+ ps.inject('HEADER' => ps.first){ |r, s, i|
38
39
  r[s[/\w+/]] = s
39
40
  r
40
41
  }
@@ -44,7 +45,7 @@ module Gemgem
44
45
  end
45
46
 
46
47
  def description
47
- @description ||= (readme['DESCRIPTION']||'').sub(/.+\n\n/, '').lines.to_a
48
+ @description ||= (readme['DESCRIPTION']||'').sub(/.+\n\n/, '').lines
48
49
  end
49
50
 
50
51
  def changes
@@ -104,9 +105,9 @@ module Gemgem
104
105
  end
105
106
 
106
107
  def split_lines ruby
107
- ruby.gsub(/(.+?)\[(.+?)\]/){ |s|
108
+ ruby.gsub(/(.+?)\s*=\s*\[(.+?)\]/){ |s|
108
109
  if $2.index(',')
109
- "#{$1}[\n #{$2.split(',').map(&:strip).join(",\n ")}]"
110
+ "#{$1} = [\n #{$2.split(',').map(&:strip).join(",\n ")}]"
110
111
  else
111
112
  s
112
113
  end
data/test/test_shell.rb CHANGED
@@ -49,6 +49,11 @@ describe Rib::Shell do
49
49
  input('obj = Object.new; def obj.inspect; raise "BOOM"; end; obj')
50
50
  end
51
51
 
52
+ should 'not crash if user input is a blackhole' do
53
+ mock(Rib).warn(/Error while printing result/)
54
+ input('Rib::Blackhole')
55
+ end
56
+
52
57
  should 'print error from eval' do
53
58
  mock(@shell).puts(/RuntimeError/)
54
59
  input('raise "blah"')
metadata CHANGED
@@ -1,32 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lin Jen-Shin (godfat)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-02 00:00:00.000000000 Z
11
+ date: 2013-05-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: ! 'Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
14
-
13
+ description: |-
14
+ Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
15
15
 
16
16
  Rib is based on the design of [ripl][] and the work of [ripl-rc][], some of
17
-
18
17
  the features are also inspired by [pry][]. The aim of Rib is to be fully
19
-
20
18
  featured and yet very easy to opt-out or opt-in other features. It shall
21
-
22
19
  be simple, lightweight and modular so that everyone could customize Rib.
23
20
 
24
-
25
21
  [ripl]: https://github.com/cldwalker/ripl
26
-
27
22
  [ripl-rc]: https://github.com/godfat/ripl-rc
28
-
29
- [pry]: https://github.com/pry/pry'
23
+ [pry]: https://github.com/pry/pry
30
24
  email:
31
25
  - godfat (XD) godfat.org
32
26
  executables:
@@ -102,7 +96,8 @@ files:
102
96
  - test/test_plugin.rb
103
97
  - test/test_shell.rb
104
98
  homepage: https://github.com/godfat/rib
105
- licenses: []
99
+ licenses:
100
+ - Apache License 2.0
106
101
  metadata: {}
107
102
  post_install_message:
108
103
  rdoc_options: []
@@ -110,17 +105,17 @@ require_paths:
110
105
  - lib
111
106
  required_ruby_version: !ruby/object:Gem::Requirement
112
107
  requirements:
113
- - - ! '>='
108
+ - - '>='
114
109
  - !ruby/object:Gem::Version
115
110
  version: '0'
116
111
  required_rubygems_version: !ruby/object:Gem::Requirement
117
112
  requirements:
118
- - - ! '>='
113
+ - - '>='
119
114
  - !ruby/object:Gem::Version
120
115
  version: '0'
121
116
  requirements: []
122
117
  rubyforge_project:
123
- rubygems_version: 2.0.0
118
+ rubygems_version: 2.0.3
124
119
  signing_key:
125
120
  specification_version: 4
126
121
  summary: Ruby-Interactive-ruBy -- Yet another interactive Ruby shell