ripl-color_result 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/.gemspec +1 -1
- data/README.rdoc +8 -4
- data/lib/ripl/color_result.rb +9 -3
- metadata +7 -7
data/.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = "A ripl plugin to colorize result."
|
12
12
|
s.description = "This ripl plugin colorizes your result."
|
13
13
|
s.required_rubygems_version = ">= 1.3.6"
|
14
|
-
s.add_dependency 'ripl', '>= 0.2.
|
14
|
+
s.add_dependency 'ripl', '>= 0.2.3'
|
15
15
|
s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec}
|
16
16
|
s.extra_rdoc_files = ["README.rdoc", "COPYING"]
|
17
17
|
s.license = 'MIT'
|
data/README.rdoc
CHANGED
@@ -4,22 +4,24 @@ This {ripl}[http://github.com/cldwalker/ripl] plugin colorizes your results.
|
|
4
4
|
== Install
|
5
5
|
Install the gem with:
|
6
6
|
|
7
|
-
sudo gem install ripl-
|
7
|
+
sudo gem install ripl-color_result
|
8
8
|
|
9
9
|
== Usage
|
10
10
|
|
11
11
|
Add to your ~/.riplrc
|
12
12
|
|
13
|
-
require 'ripl/
|
13
|
+
require 'ripl/color_result'
|
14
14
|
|
15
|
-
You can choose a <tt>:
|
15
|
+
You can choose a <tt>:color_result_engine</tt>. By default, the bundled +Wirble+-like colorization is used. Possible other values are:
|
16
16
|
|
17
17
|
* <tt>:ap</tt> - using the awesome_print gem
|
18
18
|
* <tt>:coderay</tt> - using the coderay gem
|
19
19
|
|
20
20
|
Example (in your ~/.riplrc)
|
21
21
|
|
22
|
-
Ripl.config[:
|
22
|
+
Ripl.config[:color_result_engine] = :coderay
|
23
|
+
|
24
|
+
Set it to +nil+ to deactivate result colorization.
|
23
25
|
|
24
26
|
== Credits
|
25
27
|
|
@@ -29,4 +31,6 @@ The default colorization uses code from Wirble
|
|
29
31
|
|
30
32
|
Copyright (c) 2010 Jan Lelis, http://rbjl.net. See COPYING for details.
|
31
33
|
|
34
|
+
and cldwalker.
|
35
|
+
|
32
36
|
J-_-L
|
data/lib/ripl/color_result.rb
CHANGED
@@ -1,21 +1,26 @@
|
|
1
|
+
require 'ripl'
|
2
|
+
|
1
3
|
module Ripl
|
2
4
|
module ColorResult
|
3
|
-
VERSION = '0.1.
|
5
|
+
VERSION = '0.1.1'
|
4
6
|
|
5
7
|
# def inspect_result(result)
|
6
8
|
# result.inspect
|
7
9
|
# end
|
8
10
|
|
9
11
|
def format_prompt(result)
|
10
|
-
@
|
12
|
+
@result_prompt
|
11
13
|
end
|
12
14
|
|
13
15
|
def format_result(result)
|
16
|
+
return super if !config[:color_result_engine]
|
14
17
|
format_prompt(result) + inspect_result(result)
|
15
18
|
end
|
16
19
|
|
17
20
|
def inspect_result(result)
|
18
|
-
|
21
|
+
# return super if !config[:color_result_engine]
|
22
|
+
|
23
|
+
case config[:color_result_engine].to_sym
|
19
24
|
when :coderay
|
20
25
|
require 'coderay'
|
21
26
|
CodeRay.scan( result.inspect, :ruby ).term
|
@@ -32,5 +37,6 @@ module Ripl
|
|
32
37
|
end
|
33
38
|
|
34
39
|
Ripl::Shell.send :include, Ripl::ColorResult if defined? Ripl::Shell
|
40
|
+
Ripl.config[:color_result_engine] ||= :default
|
35
41
|
|
36
42
|
# J-_-L
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ripl-color_result
|
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
|
- Jan Lelis
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-15 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 17
|
30
30
|
segments:
|
31
31
|
- 0
|
32
32
|
- 2
|
33
|
-
-
|
34
|
-
version: 0.2.
|
33
|
+
- 3
|
34
|
+
version: 0.2.3
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
description: This ripl plugin colorizes your result.
|