rib 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/rib/more/color.rb +8 -2
- data/lib/rib/version.rb +1 -1
- data/rib.gemspec +3 -3
- data/test/more/test_color.rb +19 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36e9907e98417b88befb05f1493f23737418dd34
|
4
|
+
data.tar.gz: a3b24ca77822b8f6aa5877a173303cde0b329127
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc4ead99bd2d24251849fabd4c03005fbd2ddb71dd704710dc6ebdbe22e867677c39ee665d18e27bae8f07b224bbcfee9fdb1b681a7121a17a90b3ca7692e59
|
7
|
+
data.tar.gz: 66c7f94e4549d4f63509ab8848f9227cd32660f31b98bc3ce380ff9b9431cbf6ea28c56b50a6fec9052fbf07f7f1643a161cc8a81d4ce97130fa69250e18fd16
|
data/CHANGES.md
CHANGED
data/lib/rib/more/color.rb
CHANGED
@@ -40,14 +40,20 @@ module Rib::Color
|
|
40
40
|
when Symbol ; send(colors[Symbol ]){ display }
|
41
41
|
|
42
42
|
when Array ; send(colors[Array ]){ '[' } +
|
43
|
-
result.map{ |e |
|
43
|
+
result.map{ |e | if e.object_id == result.object_id
|
44
|
+
send(colors[Array]){'[...]'}
|
45
|
+
else
|
46
|
+
format_color(e); end }.
|
44
47
|
join(send(colors[Array ]){ ', ' }) +
|
45
48
|
send(colors[Array ]){ ']' }
|
46
49
|
|
47
50
|
when Hash ; send(colors[Hash ]){ '{' } +
|
48
51
|
result.map{ |k, v| format_color(k) +
|
49
52
|
send(colors[Hash ]){ '=>' } +
|
50
|
-
|
53
|
+
if v.object_id == result.object_id
|
54
|
+
send(colors[Hash]){'{...}'}
|
55
|
+
else
|
56
|
+
format_color(v); end }.
|
51
57
|
join(send(colors[Hash ]){ ', ' }) +
|
52
58
|
send(colors[Hash ]){ '}' }
|
53
59
|
|
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.1.
|
5
|
+
s.version = "1.1.6"
|
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-
|
9
|
+
s.date = "2013-08-14"
|
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 = [
|
@@ -85,7 +85,7 @@ Gem::Specification.new do |s|
|
|
85
85
|
s.homepage = "https://github.com/godfat/rib"
|
86
86
|
s.licenses = ["Apache License 2.0"]
|
87
87
|
s.require_paths = ["lib"]
|
88
|
-
s.rubygems_version = "2.0.
|
88
|
+
s.rubygems_version = "2.0.6"
|
89
89
|
s.summary = "Ruby-Interactive-ruBy -- Yet another interactive Ruby shell"
|
90
90
|
s.test_files = [
|
91
91
|
"test/core/test_completion.rb",
|
data/test/more/test_color.rb
CHANGED
@@ -5,15 +5,15 @@ require 'rib/more/color'
|
|
5
5
|
describe Rib::Color do
|
6
6
|
behaves_like :rib
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end.new
|
8
|
+
color = Class.new do
|
9
|
+
include Rib::Color
|
10
|
+
def colors
|
11
|
+
@colors ||= Rib::Shell.new.before_loop.config[:color]
|
12
|
+
end
|
13
|
+
end.new
|
15
14
|
|
16
|
-
|
15
|
+
should 'give correct color' do
|
16
|
+
color.send(:format_color,
|
17
17
|
[{0 => :a}, 'b', [nil, {false => Object}], {true => Exception.new}]).
|
18
18
|
should.eq \
|
19
19
|
"\e[34m[\e[0m\e[34m{\e[0m\e[31m0\e[0m\e[34m=>\e[0m\e[36m:a\e[0m\e" \
|
@@ -24,6 +24,17 @@ describe Rib::Color do
|
|
24
24
|
"\e[0m\e[34m}\e[0m\e[34m]\e[0m"
|
25
25
|
end
|
26
26
|
|
27
|
+
should 'inspect recursive array and hash just like built-in inspect' do
|
28
|
+
a = []
|
29
|
+
a << a
|
30
|
+
h = {}
|
31
|
+
h[0] = h
|
32
|
+
color.send(:format_color, [a, h]).should.eq \
|
33
|
+
"\e[34m[\e[0m\e[34m[\e[0m\e[34m[...]\e[0m\e[34m]\e[0m\e[34m, \e[0m" \
|
34
|
+
"\e[34m{\e[0m\e[31m0\e[0m\e[34m=>\e[0m\e[34m{...}\e[0m\e[34m}\e[0m" \
|
35
|
+
"\e[34m]\e[0m"
|
36
|
+
end
|
37
|
+
|
27
38
|
# regression test
|
28
39
|
should "colorize errors with `/' inside" do
|
29
40
|
i = if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
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-
|
11
|
+
date: 2013-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
120
|
rubyforge_project:
|
121
|
-
rubygems_version: 2.0.
|
121
|
+
rubygems_version: 2.0.6
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
|