wirb 1.0.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
1
  # encoding: US-ASCII
2
+
2
3
  require 'stringio'
3
4
  require 'date'
4
5
 
@@ -8,61 +9,64 @@ describe tokenizer(__FILE__) do
8
9
  please do check StringIO.new 'wirb'
9
10
  if RubyEngine.rbx?
10
11
  tokens.sort.should be_like [
11
- [:class_separator, "::"],
12
- [:close_object, ">"],
13
- [:close_object, ">"],
14
- [:close_object, ">"],
15
- [:close_string, "\""],
16
- [:false, "false"],
17
- [:number, "0"],
18
- [:number, "0"],
19
- [:object_address, OBJECT_ID],
20
- [:object_address, OBJECT_ID],
21
- [:object_class, "Data"],
22
- [:object_class, "Encoding"],
23
- [:object_class, "StringIO"],
12
+ [:open_object, "#<"],
24
13
  [:object_class, "StringIO"],
14
+ [:object_description_prefix, ":"],
15
+ [:object_address, OBJECT_ID],
25
16
  [:object_description, " "],
26
- [:object_description, " "],
27
- [:object_description, " "],
28
- [:object_description, " "],
29
- [:object_description, " "],
30
- [:object_description, " "],
31
- [:object_description, " "],
32
- [:object_description, " @__data__="],
33
- [:object_description, "="],
34
- [:object_description, "="],
35
- [:object_description, "="],
17
+ [:object_variable_prefix, "@"],
18
+ [:object_variable, "append"],
36
19
  [:object_description, "="],
20
+ [:false, "false"],
21
+ [:object_description, " "],
22
+ [:object_variable_prefix, "@"],
23
+ [:object_variable, "readable"],
37
24
  [:object_description, "="],
25
+ [:true, "true"],
26
+ [:object_description, " "],
27
+ [:object_variable_prefix, "@"],
28
+ [:object_variable, "writable"],
38
29
  [:object_description, "="],
30
+ [:true, "true"],
31
+ [:object_description, " "],
32
+ [:object_variable_prefix, "@"],
33
+ [:object_variable, "__data__"],
39
34
  [:object_description, "="],
40
- [:object_description, "US-ASCII"],
41
- [:object_description_prefix, ":"],
42
- [:object_description_prefix, ":"],
35
+ [:open_object, "#<"],
36
+ [:object_class, "StringIO"],
37
+ [:class_separator, "::"],
38
+ [:object_class, "Data"],
43
39
  [:object_description_prefix, ":"],
44
- [:object_variable, "append"],
45
- [:object_variable, "encoding"],
46
- [:object_variable, "lineno"],
47
- [:object_variable, "pos"],
48
- [:object_variable, "readable"],
49
- [:object_variable, "string"],
50
- [:object_variable, "writable"],
51
- [:object_variable_prefix, "@"],
52
- [:object_variable_prefix, "@"],
53
- [:object_variable_prefix, "@"],
54
- [:object_variable_prefix, "@"],
40
+ [:object_address, OBJECT_ID],
41
+ [:object_description, " "],
55
42
  [:object_variable_prefix, "@"],
43
+ [:object_variable, "encoding"],
44
+ [:object_description, "="],
45
+ [:open_object, "#<"],
46
+ [:object_class, "Encoding"],
47
+ [:object_description_prefix, ":"],
48
+ [:object_description, "US-ASCII"],
49
+ [:close_object, ">"],
50
+ [:object_description, " "],
56
51
  [:object_variable_prefix, "@"],
52
+ [:object_variable, "lineno"],
53
+ [:object_description, "="],
54
+ [:number, "0"],
55
+ [:object_description, " "],
57
56
  [:object_variable_prefix, "@"],
58
- [:open_object, "#<"],
59
- [:open_object, "#<"],
60
- [:open_object, "#<"],
57
+ [:object_variable, "string"],
58
+ [:object_description, "="],
61
59
  [:open_string, "\""],
62
60
  [:string, "wirb"],
63
- [:true, "true"],
64
- [:true, "true"],
65
- ]
61
+ [:close_string, "\""],
62
+ [:object_description, " "],
63
+ [:object_variable_prefix, "@"],
64
+ [:object_variable, "pos"],
65
+ [:object_description, "="],
66
+ [:number, "0"],
67
+ [:close_object, ">"],
68
+ [:close_object, ">"],
69
+ ].sort
66
70
  else
67
71
  tokens.should be_like [
68
72
  [:open_object, "#<"],
@@ -100,15 +104,13 @@ describe tokenizer(__FILE__) do
100
104
  ]
101
105
  end
102
106
 
103
- only19 do
104
- please do check __ENCODING__
105
- tokens.should == [
106
- [:open_object, "#<"],
107
- [:object_class, "Encoding"],
108
- [:object_description_prefix, ":"],
109
- [:object_description, "US-ASCII"],
110
- [:close_object, ">"],
111
- ]
112
- end
107
+ please do check __ENCODING__
108
+ tokens.should == [
109
+ [:open_object, "#<"],
110
+ [:object_class, "Encoding"],
111
+ [:object_description_prefix, ":"],
112
+ [:object_description, "US-ASCII"],
113
+ [:close_object, ">"],
114
+ ]
113
115
  end
114
116
  end
@@ -39,7 +39,7 @@ describe tokenizer(__FILE__) do
39
39
  [:close_array, "]"],
40
40
  ]
41
41
  end
42
-
42
+
43
43
  please do check [2, 3, 4.0, -3, 99e99, 1e-99, 2_3_4, 4E8]
44
44
  tokens.should == [
45
45
  [:open_array, "["],
@@ -69,18 +69,17 @@ describe tokenizer(__FILE__) do
69
69
  ]
70
70
  end
71
71
 
72
- only19 do
73
- please do check Rational(2,3)
74
- tokens.should == [
75
- [:open_rational, "("],
76
- [:number, "2"],
77
- [:rational_separator, "/"],
78
- [:number, "3"],
79
- [:close_rational, ")"],
80
- ]
81
- end
72
+ please do check Rational(2,3)
73
+ tokens.should == [
74
+ [:open_rational, "("],
75
+ [:number, "2"],
76
+ [:rational_separator, "/"],
77
+ [:number, "3"],
78
+ [:close_rational, ")"],
79
+ ]
82
80
  end
83
81
 
82
+ =begin
84
83
  only18 do
85
84
  please do check Rational(2,3)
86
85
  tokens.should == [
@@ -103,12 +102,14 @@ describe tokenizer(__FILE__) do
103
102
  ]
104
103
  end
105
104
  end
105
+ =end
106
106
 
107
107
  please do check (1/0.0)
108
108
  tokens.should == [
109
109
  [:special_number, "Infinity"],
110
110
  ]
111
111
  end
112
+
112
113
  please do check [-(1/0.0), (0/0.0), -(1/0.0), -(0/0.0)]
113
114
  tokens.should == [
114
115
  [:open_array, "["],
@@ -126,26 +127,26 @@ describe tokenizer(__FILE__) do
126
127
  ]
127
128
  end
128
129
 
129
- only19 do
130
- please do check Complex(-2.2,-3.3)
131
- tokens.should == [
132
- [:open_complex, "("],
133
- [:number, "-2.2-3.3i"],
134
- [:close_complex, ")"],
135
- ]
136
- end
130
+ please do check Complex(-2.2,-3.3)
131
+ tokens.should == [
132
+ [:open_complex, "("],
133
+ [:number, "-2.2-3.3i"],
134
+ [:close_complex, ")"],
135
+ ]
136
+ end
137
137
 
138
- please do check Complex(-1/0.0, 0/0.0)
139
- tokens.should == [
140
- [:open_complex, "("],
141
- [:special_number, "-Infinity"],
142
- [:special_number, "+NaN"],
143
- [:number, '*i'],
144
- [:close_complex, ")"],
145
- ]
146
- end
138
+ please do check Complex(-1/0.0, 0/0.0)
139
+ tokens.should == [
140
+ [:open_complex, "("],
141
+ [:special_number, "-Infinity"],
142
+ [:special_number, "+NaN"],
143
+ [:number, '*i'],
144
+ [:close_complex, ")"],
145
+ ]
147
146
  end
147
+ end
148
148
 
149
+ =begin
149
150
  only18 do
150
151
  please do check Complex(-2.2,-3.3)
151
152
  tokens.should == [
@@ -160,3 +161,4 @@ describe tokenizer(__FILE__) do
160
161
  end
161
162
  end
162
163
  end
164
+ =end
@@ -35,9 +35,9 @@ describe tokenizer(__FILE__) do
35
35
  [:object_line_prefix, "@"],
36
36
  [:object_line, /.*tokenizer_object_spec.rb:/],
37
37
  [:object_line_number, /\d+/],
38
- RubyVersion >= 1.9 ? [:object_description, " (lambda)"] : nil,
38
+ [:object_description, " (lambda)"],
39
39
  [:close_object, ">"],
40
- ].compact
40
+ ]
41
41
  end
42
42
 
43
43
  please do check StringScanner.new('wirb')
@@ -65,48 +65,66 @@ describe tokenizer(__FILE__) do
65
65
  end
66
66
  end
67
67
 
68
- only19 do
69
- unless RubyEngine.jruby?
70
- please do check STDOUT
71
- tokens.should == [
72
- [:open_object, "#<"],
73
- [:object_class, "IO"],
74
- [:object_description_prefix, ":"],
75
- [:object_description, "<STDOUT>"],
76
- [:close_object, ">"],
77
- ]
78
- end
79
-
80
- please do check STDIN
81
- tokens.should == [
82
- [:open_object, "#<"],
83
- [:object_class, "IO"],
84
- [:object_description_prefix, ":"],
85
- [:object_description, "<STDIN>"],
86
- [:close_object, ">"],
87
- ]
88
- end
68
+ if RubyEngine.rbx?
69
+ please do check STDOUT
70
+ tokens.should == [
71
+ [:open_object, "#<"],
72
+ [:object_class, "IO"],
73
+ [:object_description_prefix, ":"],
74
+ [:object_description, "fd 1"],
75
+ [:close_object, ">"],
76
+ ]
89
77
  end
90
78
 
91
- please do check Module.new.singleton_class.singleton_class
92
- tokens.should be_like [
79
+ please do check STDIN
80
+ tokens.should == [
93
81
  [:open_object, "#<"],
94
- [:object_class, "Class"],
82
+ [:object_class, "IO"],
95
83
  [:object_description_prefix, ":"],
84
+ [:object_description, "fd 0"],
85
+ [:close_object, ">"],
86
+ ]
87
+ end
88
+ else
89
+ please do check STDOUT
90
+ tokens.should == [
96
91
  [:open_object, "#<"],
97
- [:object_class, "Class"],
92
+ [:object_class, "IO"],
98
93
  [:object_description_prefix, ":"],
94
+ [:object_description, "<STDOUT>"],
95
+ [:close_object, ">"],
96
+ ]
97
+ end
98
+
99
+ please do check STDIN
100
+ tokens.should == [
99
101
  [:open_object, "#<"],
100
- [:object_class, "Module"],
102
+ [:object_class, "IO"],
101
103
  [:object_description_prefix, ":"],
102
- [:object_address, OBJECT_ID],
103
- [:close_object, ">"],
104
- [:close_object, ">"],
104
+ [:object_description, "<STDIN>"],
105
105
  [:close_object, ">"],
106
106
  ]
107
107
  end
108
108
  end
109
109
 
110
+ please do check Module.new.singleton_class.singleton_class
111
+ tokens.should be_like [
112
+ [:open_object, "#<"],
113
+ [:object_class, "Class"],
114
+ [:object_description_prefix, ":"],
115
+ [:open_object, "#<"],
116
+ [:object_class, "Class"],
117
+ [:object_description_prefix, ":"],
118
+ [:open_object, "#<"],
119
+ [:object_class, "Module"],
120
+ [:object_description_prefix, ":"],
121
+ [:object_address, OBJECT_ID],
122
+ [:close_object, ">"],
123
+ [:close_object, ">"],
124
+ [:close_object, ">"],
125
+ ]
126
+ end
127
+
110
128
  please do
111
129
  SomeStruct=Struct.new :favourite, :language
112
130
  check SomeStruct.new :ruby
@@ -127,6 +145,24 @@ describe tokenizer(__FILE__) do
127
145
  ]
128
146
  end
129
147
 
148
+ please do
149
+ object = Object.new
150
+ object.instance_variable_set(:@_, 42)
151
+ check(object)
152
+ tokens.should be_like [
153
+ [:open_object, "#<"],
154
+ [:object_class, "Object"],
155
+ [:object_description_prefix, ":"],
156
+ [:object_address, /#{OBJECT_ID}/],
157
+ [:object_description, " "],
158
+ [:object_variable_prefix, "@"],
159
+ [:object_variable, "_"],
160
+ [:object_description, "="],
161
+ [:number, "42"],
162
+ [:close_object, ">"],
163
+ ]
164
+ end
165
+
130
166
  please do
131
167
  class Hey
132
168
  def initialize
data/wirb.gemspec CHANGED
@@ -1,5 +1,4 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require 'rubygems' unless defined? Gem
3
2
  require File.dirname(__FILE__) + "/lib/wirb/version"
4
3
 
5
4
  Gem::Specification.new do |s|
@@ -8,25 +7,14 @@ Gem::Specification.new do |s|
8
7
  s.authors = ["Jan Lelis"]
9
8
  s.email = "mail@janlelis.de"
10
9
  s.homepage = "https://github.com/janlelis/wirb"
11
- s.summary = "Wavy IRB: Colorizes irb results."
12
- s.description = "Wavy IRB: Colorizes irb results. It originated from Wirble, but only provides result highlighting. Just call Wirb.start and enjoy the colors in your IRB ;). You can use it with your favorite colorizer engine. See README.rdoc for more details."
13
- s.required_rubygems_version = '>= 1.3.6'
14
- s.required_ruby_version = '>= 1.8.7'
15
- s.files = Dir.glob(%w[{lib,test,spec}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} data/**/*.yml]) + %w{Rakefile wirb.gemspec .gemtest}
16
- s.extra_rdoc_files = ["README.rdoc", "COPYING.txt"]
10
+ s.summary = "WIRB Interactive Ruby"
11
+ s.description = "WIRB highlights inspected Ruby objects. It is based on the original Wirble. You can create new color schemas using yaml."
12
+ s.required_ruby_version = '~> 2.0'
13
+ s.files = Dir.glob(%w[{lib,test,spec}/**/*.rb bin/* [A-Z]*.{txt,md} ext/**/*.{rb,c} data/**/*.yml]) + %w{Rakefile wirb.gemspec}
14
+ s.extra_rdoc_files = ["README.md", "CHANGELOG.md", "COPYING.txt"]
17
15
  s.license = 'MIT'
18
- s.add_dependency 'paint', '~> 0.8'
16
+ s.add_dependency 'paint', '>= 0.9', '< 2.0'
19
17
  s.add_development_dependency 'rspec', '~> 2.14'
20
- s.add_development_dependency 'rake', '~> 10.1'
21
- s.add_development_dependency 'zucker', '~> 13'
22
- #s.add_development_dependency 'highline'
23
-
24
- len = s.homepage.size
25
- s.post_install_message = \
26
- (" ┌── " + "info ".ljust(len-2,'%') + "─┐\n" +
27
- " J-_-L │ " + s.homepage + " │\n" +
28
- " ├── " + "usage ".ljust(len-2,'%') + "─┤\n" +
29
- " │ " + "require 'wirb'".ljust(len,' ') + " │\n" +
30
- " │ " + "Wirb.start".ljust(len,' ') + " │\n" +
31
- " └─" + '─'*len + "─┘").gsub('%', '─') # 1.8 workaround
18
+ s.add_development_dependency 'rake', '~> 10.4'
19
+ s.add_development_dependency 'ruby_engine', '~> 1.0'
32
20
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wirb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-13 00:00:00.000000000 Z
11
+ date: 2015-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paint
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.9'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.8'
22
+ version: '2.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '0.8'
29
+ version: '0.9'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rspec
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -44,66 +50,52 @@ dependencies:
44
50
  requirements:
45
51
  - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: '10.1'
53
+ version: '10.4'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: '10.1'
60
+ version: '10.4'
55
61
  - !ruby/object:Gem::Dependency
56
- name: zucker
62
+ name: ruby_engine
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: '13'
67
+ version: '1.0'
62
68
  type: :development
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: '13'
69
- description: 'Wavy IRB: Colorizes irb results. It originated from Wirble, but only
70
- provides result highlighting. Just call Wirb.start and enjoy the colors in your
71
- IRB ;). You can use it with your favorite colorizer engine. See README.rdoc for
72
- more details.'
74
+ version: '1.0'
75
+ description: WIRB highlights inspected Ruby objects. It is based on the original Wirble.
76
+ You can create new color schemas using yaml.
73
77
  email: mail@janlelis.de
74
78
  executables: []
75
79
  extensions: []
76
80
  extra_rdoc_files:
77
- - README.rdoc
81
+ - README.md
82
+ - CHANGELOG.md
78
83
  - COPYING.txt
79
84
  files:
80
- - ".gemtest"
81
- - CHANGELOG.rdoc
85
+ - CHANGELOG.md
82
86
  - COPYING.txt
83
- - README.rdoc
87
+ - README.md
84
88
  - Rakefile
85
- - data/wirb/classic_paint.yml
86
- - data/wirb/classic_wirb0.yml
89
+ - data/wirb/classic.yml
87
90
  - data/wirb/colorless.yml
91
+ - data/wirb/gray.yml
88
92
  - lib/wirb.rb
89
- - lib/wirb/colorizer.rb
90
- - lib/wirb/colorizer/highline.rb
91
- - lib/wirb/colorizer/paint.rb
92
- - lib/wirb/colorizer/wirb0.rb
93
- - lib/wirb/colorizer/wirb0_highline.rb
94
- - lib/wirb/colorizer/wirb0_paint.rb
95
- - lib/wirb/colorizer/wirble.rb
93
+ - lib/wirb/inspector.rb
96
94
  - lib/wirb/irb.rb
95
+ - lib/wirb/schema_builder.rb
97
96
  - lib/wirb/tokenizer.rb
98
97
  - lib/wirb/version.rb
99
98
  - lib/wirb/wp.rb
100
- - spec/colorizer_highline_spec.rb
101
- - spec/colorizer_paint_spec.rb
102
- - spec/colorizer_spec.rb
103
- - spec/colorizer_wirb0_highline_spec.rb
104
- - spec/colorizer_wirb0_paint_spec.rb
105
- - spec/colorizer_wirb0_spec.rb
106
- - spec/colorizer_wirble_spec.rb
107
99
  - spec/spec_helper.rb
108
100
  - spec/tokenizer_array_spec.rb
109
101
  - spec/tokenizer_enumerator_spec.rb
@@ -115,7 +107,6 @@ files:
115
107
  - spec/tokenizer_object_spec.rb
116
108
  - spec/tokenizer_rails_spec.rb
117
109
  - spec/tokenizer_regexp_spec.rb
118
- - spec/tokenizer_rubygems_spec.rb
119
110
  - spec/tokenizer_rubyvm_spec.rb
120
111
  - spec/tokenizer_set_spec.rb
121
112
  - spec/tokenizer_string_spec.rb
@@ -126,30 +117,24 @@ homepage: https://github.com/janlelis/wirb
126
117
  licenses:
127
118
  - MIT
128
119
  metadata: {}
129
- post_install_message: |2-
130
- ┌── info ──────────────────────────┐
131
- J-_-L │ https://github.com/janlelis/wirb │
132
- ├── usage ─────────────────────────┤
133
- │ require 'wirb' │
134
- │ Wirb.start │
135
- └──────────────────────────────────┘
120
+ post_install_message:
136
121
  rdoc_options: []
137
122
  require_paths:
138
123
  - lib
139
124
  required_ruby_version: !ruby/object:Gem::Requirement
140
125
  requirements:
141
- - - ">="
126
+ - - "~>"
142
127
  - !ruby/object:Gem::Version
143
- version: 1.8.7
128
+ version: '2.0'
144
129
  required_rubygems_version: !ruby/object:Gem::Requirement
145
130
  requirements:
146
131
  - - ">="
147
132
  - !ruby/object:Gem::Version
148
- version: 1.3.6
133
+ version: '0'
149
134
  requirements: []
150
135
  rubyforge_project:
151
- rubygems_version: 2.2.0
136
+ rubygems_version: 2.4.6
152
137
  signing_key:
153
138
  specification_version: 4
154
- summary: 'Wavy IRB: Colorizes irb results.'
139
+ summary: WIRB Interactive Ruby
155
140
  test_files: []