ripl-color_error 0.1.0 → 0.1.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/README.rdoc +1 -1
- data/lib/ripl/color_error.rb +5 -7
- metadata +4 -4
data/CHANGELOG.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -34,5 +34,5 @@ While in the console you can change colors as desired:
|
|
34
34
|
>> Ripl::ColorError::COLORS
|
35
35
|
|
36
36
|
To explore ansi escape codes, see {here}[http://en.wikipedia.org/wiki/ANSI_escape_code]. With
|
37
|
-
|
37
|
+
the correct code you can bold, underline, add a background color ...
|
38
38
|
|
data/lib/ripl/color_error.rb
CHANGED
@@ -1,13 +1,10 @@
|
|
1
|
+
require 'ripl'
|
2
|
+
|
1
3
|
module Ripl
|
2
4
|
module ColorError
|
3
|
-
VERSION = '0.1.
|
5
|
+
VERSION = '0.1.1'
|
4
6
|
COLORS = {:red=>31, :green=>32, :yellow=>33, :blue=>34, :purple=>35, :cyan=>36}
|
5
7
|
|
6
|
-
def before_loop
|
7
|
-
Ripl.config[:color_error] ||= :red
|
8
|
-
super
|
9
|
-
end
|
10
|
-
|
11
8
|
def format_error(error)
|
12
9
|
color_code = config[:color_error].to_s[/^[\d;]+$/] || !config[:color_error] ?
|
13
10
|
config[:color_error] : COLORS[config[:color_error].to_sym]
|
@@ -16,4 +13,5 @@ module Ripl
|
|
16
13
|
end
|
17
14
|
end
|
18
15
|
|
19
|
-
Ripl::Shell.send :include, Ripl::ColorError
|
16
|
+
Ripl::Shell.send :include, Ripl::ColorError
|
17
|
+
Ripl.config[:color_error] ||= :red
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ripl-color_error
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gabriel Horner
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-16 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|