wirb 1.0.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{CHANGELOG.rdoc → CHANGELOG.md} +51 -25
- data/COPYING.txt +5 -5
- data/README.md +75 -0
- data/data/wirb/{classic_paint.yml → classic.yml} +11 -42
- data/data/wirb/colorless.yml +10 -27
- data/data/wirb/gray.yml +103 -0
- data/lib/wirb.rb +69 -114
- data/lib/wirb/inspector.rb +10 -0
- data/lib/wirb/irb.rb +3 -12
- data/lib/wirb/schema_builder.rb +44 -0
- data/lib/wirb/tokenizer.rb +404 -430
- data/lib/wirb/version.rb +1 -1
- data/lib/wirb/wp.rb +3 -7
- data/spec/spec_helper.rb +5 -122
- data/spec/tokenizer_enumerator_spec.rb +580 -37
- data/spec/tokenizer_misc_spec.rb +55 -53
- data/spec/tokenizer_number_spec.rb +30 -28
- data/spec/tokenizer_object_spec.rb +67 -31
- data/wirb.gemspec +8 -20
- metadata +33 -48
- data/.gemtest +0 -0
- data/README.rdoc +0 -79
- data/data/wirb/classic_wirb0.yml +0 -72
- data/lib/wirb/colorizer.rb +0 -26
- data/lib/wirb/colorizer/highline.rb +0 -16
- data/lib/wirb/colorizer/paint.rb +0 -11
- data/lib/wirb/colorizer/wirb0.rb +0 -53
- data/lib/wirb/colorizer/wirb0_highline.rb +0 -73
- data/lib/wirb/colorizer/wirb0_paint.rb +0 -71
- data/lib/wirb/colorizer/wirble.rb +0 -30
- data/spec/colorizer_highline_spec.rb +0 -23
- data/spec/colorizer_paint_spec.rb +0 -33
- data/spec/colorizer_spec.rb +0 -67
- data/spec/colorizer_wirb0_highline_spec.rb +0 -78
- data/spec/colorizer_wirb0_paint_spec.rb +0 -35
- data/spec/colorizer_wirb0_spec.rb +0 -11
- data/spec/colorizer_wirble_spec.rb +0 -24
- data/spec/tokenizer_rubygems_spec.rb +0 -84
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e66ad01b5a8d397758b52ad80a47c04088edd84a
|
4
|
+
data.tar.gz: 433bcf5da92a4a1e8a15b03f701a6e50b854f7d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c557117bcf11f894d1fe0fb03671bf3784bb24bc384bfd961b71519041be1ffefeb20aecaa941b5d376a89e826c612d06b6ae28485910f7744d85e99287e013
|
7
|
+
data.tar.gz: fe2d2e2662c8a92c75bd7eed4da18736beafea93ba064f564f92ba93b551d2dd13fa8334c9a4b96d134025aa48a9bb5f66e8b4a567818d0a6e2fd7aa9fd50e55
|
@@ -1,67 +1,93 @@
|
|
1
|
-
|
1
|
+
## 2.0.0
|
2
|
+
### Main Changes
|
3
|
+
* Don't target Ruby 1 anymore, set required Ruby version to 2.0
|
4
|
+
* Change the way WIRB is integrated into IRB: Now uses the IRB API, instead
|
5
|
+
of monkey patch
|
6
|
+
* Remove abstraction for alternative colorizers, only use paint
|
7
|
+
* Introduce timeout option: If WIRB hasn't finised applying colors within 3
|
8
|
+
seconds, it will skip rendering the string
|
9
|
+
* Support rubinius enumerators
|
10
|
+
|
11
|
+
### Minor Changes
|
12
|
+
* Rename :keyword token to :word (e.g. main) and more token renamings
|
13
|
+
* Simplify setting delimiters in schema (e.g. :array instead of :open_array
|
14
|
+
and :close_array)
|
15
|
+
* Move exception handling out of tokenizer
|
16
|
+
* Remove parsing rules for 1.8 and rubygem dependencies
|
17
|
+
* Fix that @instance variables beginning with underscore get detected
|
18
|
+
|
19
|
+
## 1.0.3
|
2
20
|
* Allow nestings of objects in object description
|
3
21
|
|
4
|
-
|
22
|
+
## 1.0.2
|
5
23
|
* Fix a bug that would load wirb irb hooks in non irb environments
|
6
24
|
|
7
|
-
|
25
|
+
## 1.0.0 / 1.0.1
|
8
26
|
* Paint gem is a dependency
|
9
27
|
|
10
|
-
|
28
|
+
## 0.5.0
|
11
29
|
* Use magenta instead of black for strings (better readable)
|
12
30
|
* Fix bug with StringScanner objects
|
13
31
|
* Support complex numbers
|
14
32
|
* Support Infinity and NaN as valid numbers
|
15
33
|
* Default colorizer is now Paint
|
16
34
|
|
17
|
-
|
35
|
+
## 0.4.2
|
18
36
|
* Fix a symbol string bug
|
19
37
|
* Don't fail on nil input for Wirb.tokenize
|
20
38
|
|
21
|
-
|
39
|
+
## 0.4.1
|
22
40
|
* New bundled color schema: colorless (use at least Paint version 0.8.2)
|
23
41
|
* Fix minor bugs of 0.4.0
|
24
42
|
|
25
|
-
|
43
|
+
## 0.4.0
|
26
44
|
* Add support for loading color schemas from yaml files
|
27
45
|
* Add ability to hook in a custom colorizer
|
28
|
-
* Support for Paint, HighLine (1.6.3), old Wirb color names (Wirb0) and
|
29
|
-
|
30
|
-
*
|
31
|
-
|
46
|
+
* Support for Paint, HighLine (1.6.3), old Wirb color names (Wirb0) and
|
47
|
+
even older Wirble color names
|
48
|
+
* Wirb0(-like) colors are still default, but will be dropped (as
|
49
|
+
default) in 1.0
|
50
|
+
* Provides hybrid connectors to Paint and HighLine that also enable Wirb
|
51
|
+
colors (Wirb0_Paint, Wirb0_HighLine)
|
52
|
+
* Only display error on failed tokenizations if $VERBOSE is not false
|
32
53
|
|
33
|
-
|
54
|
+
## 0.3.2
|
34
55
|
* Improve :<=> parsing :D
|
35
|
-
* Support gem requirements (:gem_requirement_condition,
|
56
|
+
* Support gem requirements (:gem_requirement_condition,
|
57
|
+
:gem_requirement_version) and gem dependencies
|
36
58
|
|
37
|
-
|
59
|
+
## 0.3.1
|
38
60
|
* Fix ;$., ;$", :$,
|
39
61
|
|
40
|
-
|
62
|
+
## 0.3.0
|
41
63
|
* Improve 1.9 enumerator detection/highlighting
|
42
|
-
* Remove :open_enumerator / :close_enumerator (use nested usual base
|
64
|
+
* Remove :open_enumerator / :close_enumerator (use nested usual base
|
65
|
+
objects instead)
|
43
66
|
* Support timestamps (:timestamp)
|
44
|
-
* Support instance variables and their contents (:object_variable,
|
67
|
+
* Support instance variables and their contents (:object_variable,
|
68
|
+
:object_variable_prefix)
|
45
69
|
* Add Wirb.stop to not colorize anything, anymore (in irb)
|
46
70
|
* Support RubyVM instruction sequences
|
47
71
|
|
48
|
-
|
72
|
+
## 0.2.6
|
49
73
|
* Fix Ruby 1.8 "already initialized constant" warnings
|
50
74
|
|
51
|
-
|
52
|
-
* Fix wrong
|
75
|
+
## 0.2.5
|
76
|
+
* Fix wrong \ escaping
|
53
77
|
* Fix stupid rescue bug (no more wirb crashes)
|
54
78
|
|
55
|
-
|
79
|
+
## 0.2.3 / 0.2.4
|
56
80
|
* Support for rubygems-test <gem-testers.org>
|
57
81
|
|
58
|
-
|
59
|
-
* Always return inspected string (even when errors happen) and endless-loop
|
82
|
+
## 0.2.2
|
83
|
+
* Always return inspected string (even when errors happen) and endless-loop
|
84
|
+
protection
|
60
85
|
* Recognize active record class descriptions
|
61
86
|
|
62
|
-
|
87
|
+
## 0.2.1
|
63
88
|
* Fix 1.8 Rational after requiring 'mathn'
|
64
89
|
* Return of string if tokenizer throws an error
|
65
90
|
|
66
|
-
|
91
|
+
## 0.2.0
|
67
92
|
* Initial release.
|
93
|
+
|
data/COPYING.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
Copyright (C) 2011-
|
1
|
+
Copyright (C) 2011-2015 Jan Lelis <mail@janlelis.de>
|
2
2
|
Copyright (C) 2006-2009 Paul Duncan <pabs@pablotron.org>
|
3
|
-
|
3
|
+
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a
|
5
5
|
copy of this software and associated documentation files (the
|
6
6
|
"Software"), to deal in the Software without restriction, including
|
@@ -8,14 +8,14 @@ without limitation the rights to use, copy, modify, merge, publish,
|
|
8
8
|
distribute, sublicense, and/or sell copies of the Software, and to
|
9
9
|
permit persons to whom the Software is furnished to do so, subject to
|
10
10
|
the following conditions:
|
11
|
-
|
11
|
+
|
12
12
|
The above copyright notice and this permission notice shall be included
|
13
13
|
in all copies or substantial portions of the of the Software.
|
14
|
-
|
14
|
+
|
15
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
16
16
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
17
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
18
18
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20
20
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21
|
-
DEALINGS IN THE SOFTWARE.
|
21
|
+
DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
## WIRB Interactive Ruby [![version](https://badge.fury.io/rb/wirb.svg)](http://badge.fury.io/rb/wirb) [<img src="https://travis-ci.org/janlelis/wirb.png" />](https://travis-ci.org/janlelis/wirb)
|
2
|
+
|
3
|
+
**WIRB** syntax highlights Ruby objects.
|
4
|
+
|
5
|
+
Supported Rubies: 2.2, 2.1, 2.0, jruby, rubinius.
|
6
|
+
|
7
|
+
Legacy Rubies (1.9, 1.8): Use [WIRB 1.0](https://github.com/janlelis/wirb/tree/1.0.3)
|
8
|
+
|
9
|
+
[Example output](https://travis-ci.org/janlelis/wirb/jobs/56299603)
|
10
|
+
|
11
|
+
|
12
|
+
## Features
|
13
|
+
|
14
|
+
* Syntax highlighting for Ruby objects
|
15
|
+
* No monkey patches anywhere
|
16
|
+
* Support for generic objects, especially enumerators, and nested generic
|
17
|
+
objects
|
18
|
+
* Can be used without IRB
|
19
|
+
* Supports stdlib objects, like `Set`
|
20
|
+
* Custom color schemas via YAML
|
21
|
+
|
22
|
+
## Install
|
23
|
+
|
24
|
+
Install the gem with:
|
25
|
+
|
26
|
+
$ gem install wirb
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
To start IRB with WIRB activated for one session, do:
|
31
|
+
|
32
|
+
$ irb -r wirb --inspect wirb
|
33
|
+
|
34
|
+
To activate WIRB permanently, you'll need to add this to the `~/.irbrc` file:
|
35
|
+
|
36
|
+
require 'wirb'
|
37
|
+
Wirb.start
|
38
|
+
|
39
|
+
### Bundled Schemas
|
40
|
+
|
41
|
+
These are the bundled color schemas. You can load one with `Wirb.load_schema
|
42
|
+
:name`
|
43
|
+
|
44
|
+
* `:classic` (default)
|
45
|
+
* `:colorless` (only uses :bright, :underline and :inverse effect)
|
46
|
+
|
47
|
+
|
48
|
+
## `Kernel#wp`
|
49
|
+
|
50
|
+
You can use WIRB like awesome_print to highlight any objects using `wp`:
|
51
|
+
|
52
|
+
require 'wirb/wp'
|
53
|
+
wp some_object
|
54
|
+
|
55
|
+
## Also See
|
56
|
+
|
57
|
+
* Gem that allows you to configure views for specific objects:
|
58
|
+
[hirb](https://github.com/cldwalker/hirb)
|
59
|
+
* WIRB is part of: [irbtools](https://github.com/janlelis/irbtools)
|
60
|
+
* RIPL is an IRB alternative, syntax highlighting plugin (uses wirb by
|
61
|
+
default):
|
62
|
+
[ripl-color_result](https://github.com/janlelis/ripl-color_result)
|
63
|
+
* More about terminal colors: [Paint](https://github.com/janlelis/paint)
|
64
|
+
* [Wirble](http://pablotron.org/software/wirble/): WIRB's predecessor
|
65
|
+
|
66
|
+
|
67
|
+
## Credits
|
68
|
+
|
69
|
+
Copyright (c) 2011-2015 Jan Lelis <http://janlelis.com> see COPYING for
|
70
|
+
details.
|
71
|
+
|
72
|
+
Influenced by code from: Copyright (C) 2006-2009 Paul Duncan
|
73
|
+
<pabs@pablotron.org>
|
74
|
+
|
75
|
+
[All contributors](https://github.com/janlelis/wirb/contributors)
|
@@ -1,23 +1,11 @@
|
|
1
|
-
colorizer:
|
2
|
-
- Paint
|
3
|
-
- Wirb0_Paint
|
4
|
-
|
5
1
|
# container
|
6
|
-
|
7
|
-
- :green
|
8
|
-
- :bright
|
9
|
-
close_hash:
|
10
|
-
- :green
|
11
|
-
- :bright
|
12
|
-
open_array:
|
2
|
+
hash_delimiter:
|
13
3
|
- :green
|
14
4
|
- :bright
|
15
|
-
|
5
|
+
array_delimiter:
|
16
6
|
- :green
|
17
7
|
- :bright
|
18
|
-
|
19
|
-
- :green
|
20
|
-
close_set:
|
8
|
+
set_delimiter:
|
21
9
|
- :green
|
22
10
|
|
23
11
|
# delimiter
|
@@ -35,7 +23,7 @@ object_class:
|
|
35
23
|
- :bright
|
36
24
|
|
37
25
|
# object
|
38
|
-
|
26
|
+
object_delimiter:
|
39
27
|
- :green
|
40
28
|
object_description_prefix:
|
41
29
|
- :green
|
@@ -62,8 +50,6 @@ object_variable_prefix:
|
|
62
50
|
object_variable:
|
63
51
|
- :magenta
|
64
52
|
- :bright
|
65
|
-
close_object:
|
66
|
-
- :green
|
67
53
|
|
68
54
|
# symbol
|
69
55
|
symbol_prefix:
|
@@ -72,29 +58,22 @@ symbol_prefix:
|
|
72
58
|
symbol:
|
73
59
|
- :yellow
|
74
60
|
- :bright
|
75
|
-
open_symbol_string:
|
76
|
-
- :yellow
|
77
61
|
symbol_string:
|
78
62
|
- :yellow
|
79
63
|
- :bright
|
80
|
-
|
64
|
+
symbol_string_delimiter:
|
81
65
|
- :yellow
|
82
66
|
|
83
67
|
# string
|
84
|
-
open_string:
|
85
|
-
- :white
|
86
68
|
string:
|
87
69
|
- :magenta
|
88
|
-
|
70
|
+
string_delimiter:
|
89
71
|
- :white
|
90
72
|
|
91
73
|
# regexp
|
92
|
-
open_regexp:
|
93
|
-
- :blue
|
94
|
-
- :bright
|
95
74
|
regexp:
|
96
75
|
- :magenta
|
97
|
-
|
76
|
+
regexp_delimiter:
|
98
77
|
- :blue
|
99
78
|
- :bright
|
100
79
|
regexp_flags:
|
@@ -108,25 +87,20 @@ special_number:
|
|
108
87
|
- :cyan
|
109
88
|
range:
|
110
89
|
- :red
|
111
|
-
|
90
|
+
rational_delimiter:
|
112
91
|
- :cyan
|
113
92
|
- :bright
|
114
93
|
rational_separator:
|
115
94
|
- :cyan
|
116
95
|
- :bright
|
117
|
-
|
118
|
-
- :cyan
|
119
|
-
- :bright
|
120
|
-
open_complex:
|
121
|
-
- :cyan
|
122
|
-
close_complex:
|
96
|
+
complex_delimiter:
|
123
97
|
- :cyan
|
124
98
|
|
125
99
|
# misc
|
126
|
-
#default:
|
127
|
-
#keyword:
|
128
100
|
time:
|
129
101
|
- :magenta
|
102
|
+
word:
|
103
|
+
- :blue
|
130
104
|
nil:
|
131
105
|
- :red
|
132
106
|
- :bright
|
@@ -134,8 +108,3 @@ false:
|
|
134
108
|
- :red
|
135
109
|
true:
|
136
110
|
- :green
|
137
|
-
gem_requirement_condition:
|
138
|
-
- :cyan
|
139
|
-
gem_requirement_version:
|
140
|
-
- :cyan
|
141
|
-
- :bright
|
data/data/wirb/colorless.yml
CHANGED
@@ -1,14 +1,7 @@
|
|
1
|
-
colorizer:
|
2
|
-
- Paint
|
3
|
-
- Wirb0_Paint
|
4
|
-
|
5
1
|
# container
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
close_array:
|
10
|
-
open_set:
|
11
|
-
close_set:
|
2
|
+
hash_delimiter:
|
3
|
+
array_delimiter:
|
4
|
+
set_delimiter:
|
12
5
|
|
13
6
|
# delimiter
|
14
7
|
comma:
|
@@ -22,7 +15,7 @@ object_class:
|
|
22
15
|
- :bright
|
23
16
|
|
24
17
|
# object
|
25
|
-
|
18
|
+
object_delimiter:
|
26
19
|
object_description_prefix:
|
27
20
|
object_description:
|
28
21
|
object_address_prefix:
|
@@ -32,28 +25,24 @@ object_line:
|
|
32
25
|
object_line_number:
|
33
26
|
object_variable_prefix:
|
34
27
|
object_variable:
|
35
|
-
close_object:
|
36
28
|
|
37
29
|
# symbol
|
38
30
|
symbol_prefix:
|
39
31
|
symbol:
|
40
32
|
- :bright
|
41
|
-
open_symbol_string:
|
42
33
|
symbol_string:
|
43
34
|
- :bright
|
44
|
-
|
35
|
+
symbol_string_delimiter:
|
45
36
|
|
46
37
|
# string
|
47
|
-
open_string:
|
48
38
|
string:
|
49
39
|
- :underline
|
50
|
-
|
40
|
+
string_delimiter:
|
51
41
|
|
52
42
|
# regexp
|
53
|
-
open_regexp:
|
54
43
|
regexp:
|
55
44
|
- :underline
|
56
|
-
|
45
|
+
regexp_delimiter:
|
57
46
|
regexp_flags:
|
58
47
|
|
59
48
|
# number
|
@@ -62,22 +51,16 @@ number:
|
|
62
51
|
special_number:
|
63
52
|
- :bright
|
64
53
|
range:
|
65
|
-
|
54
|
+
rational:
|
66
55
|
rational_separator:
|
67
|
-
|
68
|
-
open_complex:
|
69
|
-
close_complex:
|
56
|
+
complex:
|
70
57
|
|
71
58
|
# misc
|
72
|
-
default:
|
73
|
-
keyword:
|
74
59
|
time:
|
60
|
+
word:
|
75
61
|
nil:
|
76
62
|
- :inverse
|
77
63
|
false:
|
78
64
|
- :inverse
|
79
65
|
true:
|
80
66
|
- :inverse
|
81
|
-
gem_requirement_condition:
|
82
|
-
- :bright
|
83
|
-
gem_requirement_version:
|
data/data/wirb/gray.yml
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# container
|
2
|
+
hash:
|
3
|
+
- "#ccc"
|
4
|
+
array:
|
5
|
+
- "#ddd"
|
6
|
+
set:
|
7
|
+
- "#bbb"
|
8
|
+
|
9
|
+
# delimiter
|
10
|
+
comma: "#fff"
|
11
|
+
refers: "#fff"
|
12
|
+
|
13
|
+
# class
|
14
|
+
class:
|
15
|
+
- "#999"
|
16
|
+
class_separator:
|
17
|
+
- "#777"
|
18
|
+
object_class:
|
19
|
+
- "#888"
|
20
|
+
|
21
|
+
# object
|
22
|
+
object:
|
23
|
+
- "#666"
|
24
|
+
object_description_prefix:
|
25
|
+
- "#222"
|
26
|
+
object_description:
|
27
|
+
- "#555"
|
28
|
+
object_address_prefix:
|
29
|
+
- "#111"
|
30
|
+
object_address:
|
31
|
+
- "#555"
|
32
|
+
object_line_prefix:
|
33
|
+
- "#222"
|
34
|
+
object_line:
|
35
|
+
- "yellow"
|
36
|
+
object_line_number:
|
37
|
+
- "gold"
|
38
|
+
object_variable_prefix:
|
39
|
+
- "white"
|
40
|
+
object_variable:
|
41
|
+
- "silver"
|
42
|
+
|
43
|
+
# symbol
|
44
|
+
symbol_prefix:
|
45
|
+
- "#9f9"
|
46
|
+
- :bright
|
47
|
+
symbol:
|
48
|
+
- "#9f9"
|
49
|
+
- :bright
|
50
|
+
symbol_string:
|
51
|
+
- "#9f9"
|
52
|
+
- :bright
|
53
|
+
symbol_string_delimetr:
|
54
|
+
- "#9f9"
|
55
|
+
|
56
|
+
# string
|
57
|
+
string:
|
58
|
+
- "#99f"
|
59
|
+
string_delimiter:
|
60
|
+
- "#99f"
|
61
|
+
- :bright
|
62
|
+
|
63
|
+
# regexp
|
64
|
+
regexp:
|
65
|
+
- :magenta
|
66
|
+
regexp_delimiter:
|
67
|
+
- :blue
|
68
|
+
- :bright
|
69
|
+
regexp_flags:
|
70
|
+
- :red
|
71
|
+
- :bright
|
72
|
+
|
73
|
+
# number
|
74
|
+
number:
|
75
|
+
- "white"
|
76
|
+
special_number:
|
77
|
+
- "silver"
|
78
|
+
range:
|
79
|
+
- "#f0f0f0"
|
80
|
+
rational:
|
81
|
+
- "#ddd"
|
82
|
+
rational_separator:
|
83
|
+
- "#ddd"
|
84
|
+
complex:
|
85
|
+
- "#ccc"
|
86
|
+
|
87
|
+
# misc
|
88
|
+
#default:
|
89
|
+
time:
|
90
|
+
- :underline
|
91
|
+
word:
|
92
|
+
- :blue
|
93
|
+
nil:
|
94
|
+
- :red
|
95
|
+
- :bright
|
96
|
+
false:
|
97
|
+
- :red
|
98
|
+
true:
|
99
|
+
- :green
|
100
|
+
gem_requirement_condition:
|
101
|
+
- "#eee"
|
102
|
+
gem_requirement_version:
|
103
|
+
- "#ddd"
|