wirb 1.0.2 → 1.0.3

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9e05f349d31a148f70a770c97929873ac2ea307d
4
+ data.tar.gz: 463451317b4c61812b414d0496cbd80a7b0edcaa
5
+ SHA512:
6
+ metadata.gz: dca03385ef04bcde1660451961b5f79655f1c27e88fd84549ee4f4c70a1925860f810282409490eb3947c47fb1a988f702eeaa300ce118463f6aff2f118ed804
7
+ data.tar.gz: f312a562ebce3fc95614c2faa1ce40d75f6dc9eebff7bfa8859a8d6f73f17f57d9d6a308878ee0e3a5fc00129655c6b6a655949dd0c3f08376a87a8468968e8f
@@ -1,3 +1,6 @@
1
+ == 1.0.3
2
+ * Allow nestings of objects in object description
3
+
1
4
  == 1.0.2
2
5
  * Fix a bug that would load wirb irb hooks in non irb environments
3
6
 
@@ -1,4 +1,4 @@
1
- Copyright (C) 2011-2012 Jan Lelis <mail@janlelis.de>
1
+ Copyright (C) 2011-2014 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
@@ -1,7 +1,9 @@
1
- == Wavy Interactive Ruby {<img src="https://travis-ci.org/janlelis/wirb.png" />}[https://travis-ci.org/janlelis/wirb]
1
+ == Wirb Interactive Ruby {<img src="https://travis-ci.org/janlelis/wirb.png" />}[https://travis-ci.org/janlelis/wirb]
2
2
 
3
3
  *Wirb* colorizes your inspected Ruby objects. It is based on Wirble[http://pablotron.org/software/wirble/], but only provides and improves result highlighting. It also provides a colorization engine abstraction layer and offers flexible schemas using yaml. Wirb is part of the {irbtools suite}[https://github.com/janlelis/irbtools].
4
4
 
5
+ Supported Rubies: 2.1, 2.0, 1.9, 1.8, jruby, rubinius
6
+
5
7
  == Install
6
8
 
7
9
  Install the gem with:
@@ -18,15 +20,19 @@ Add to your <tt>~/.irbrc</tt>
18
20
  == Features
19
21
 
20
22
  * Syntax highlighting for Ruby objects
21
- * Does not change the inspect value
22
- * Support for generic objects, especially sets and enumerators
23
- * Comes with tests
23
+ * Does not change the inspect method
24
+ * Support for generic objects, especially sets and enumerators and nesting more generic objects
25
+ * Funny looking test suite
24
26
  * Can be used without irb
25
27
  * Limited stdlib/gem objects support (e.g. Set, Gem::Requirement)
26
- * Supports 1.8, 1.9, jruby, rbx, head
27
28
  * Usable with any supported terminal colors engine
28
29
  * Color schemas in yaml files
29
30
 
31
+ == wp
32
+ You can colorize any object with <tt>wp</tt> (wavy_print):
33
+ require 'wirb/wp'
34
+ wp some_object
35
+
30
36
  == Colors
31
37
 
32
38
  To only tweak some colors, take a look at the <tt>Wirb.schema</tt> hash. To use a custom schema, inspect the yaml files in the <tt>data/wirb/</tt> directory. You can create your own schema and load it using <tt>Wirb.load_schema(path_to_yaml_file)</tt>. Alternatively, you can use one of the bundled ones by passing a symbol instead of a path.
@@ -57,11 +63,6 @@ The following schemas are bundled (load with <tt>Wirb.load_schema :name</tt> and
57
63
  * <tt>:colorless</tt> (only uses :bright, :underline and :inverse effect)
58
64
  * <tt>:classic_wirb0</tt> (default implemented with wirb0)
59
65
 
60
- == wp
61
- You can colorize any object with <tt>wp</tt> (wavy_print):
62
- require 'wirb/wp'
63
- wp some_object
64
-
65
66
  == Also see
66
67
 
67
68
  * Configure views for specific objects: hirb[https://github.com/cldwalker/hirb]
@@ -69,19 +70,10 @@ You can colorize any object with <tt>wp</tt> (wavy_print):
69
70
  * ripl is an irb alternative, syntax highlighting plugin (uses wirb by default): ripl-color_result[https://github.com/janlelis/ripl-color_result]
70
71
  * Advanced terminal color gems: Paint[https://github.com/janlelis/paint], HighLine[https://github.com/JEG2/highline]
71
72
 
72
- == Todo
73
- * Tests for schema stuff
74
- * More colorizers and themes
75
- * Keep up with latest core/stdlib/rubygems inspects
76
- * Keep up with new Rubinius versions
77
-
78
73
  == Credits
79
- * Copyright (c) 2011, 2013 Jan Lelis <http://happycode.org>, see COPYING for details.
80
74
 
81
- Contributions[https://github.com/janlelis/wirb/contributors] by and thanks to:
82
- * {Richard LeBer}[https://github.com/rleber]
75
+ Copyright (c) 2011-2014 Jan Lelis <http://janlelis.de>, see COPYING for details.
83
76
 
84
- Influenced by code from and thanks to:
85
- * Copyright (C) 2006-2009 Paul Duncan <pabs@pablotron.org>
77
+ Influenced by code from and thanks to: Copyright (C) 2006-2009 Paul Duncan <pabs@pablotron.org>
86
78
 
87
- J-_-L
79
+ Contributions[https://github.com/janlelis/wirb/contributors] by and thanks to: {Richard LeBer}[https://github.com/rleber]
data/Rakefile CHANGED
@@ -24,7 +24,7 @@ end
24
24
 
25
25
  desc "Install the gem locally"
26
26
  task :install => :gem do
27
- sh %{gem install pkg/#{gemspec.name}-#{gemspec.version} --no-rdoc --no-ri}
27
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}.gem --no-rdoc --no-ri}
28
28
  end
29
29
 
30
30
  desc "Generate the gemspec"
@@ -1,7 +1,7 @@
1
1
  class << Wirb
2
2
  # This is an extended version of the original wirble tokenizer.
3
- # Almost everyone would say that 400 lines long case statements need refactoring, but
4
- # ...sometimes it just doesn't matter ;)
3
+ # Many people would say that 400 lines long case statements need refactoring, but
4
+ # ...sometimes it is supposed to be this way!
5
5
  def tokenize(str)
6
6
  return [] if str.nil?
7
7
  raise ArgumentError, 'Tokenizer needs an inspect-string' unless str.is_a? String
@@ -368,6 +368,13 @@ class << Wirb
368
368
  open_brackets -= 1
369
369
  @token << c
370
370
  end
371
+ when '#'
372
+ if nc == '<'
373
+ pass_state[]
374
+ push_state[:object]
375
+ else
376
+ @token << c
377
+ end
371
378
  when '<'
372
379
  open_brackets += 1
373
380
  @token << c
@@ -1,3 +1,3 @@
1
1
  module Wirb
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
@@ -7,47 +7,62 @@ describe tokenizer(__FILE__) do
7
7
 
8
8
  please do check StringIO.new 'wirb'
9
9
  if RubyEngine.rbx?
10
- =begin TODO sort ivars
11
- tokens.should be_like [
12
- [:open_object, "#<"],
13
- [:object_class, "StringIO"],
14
- [:object_description_prefix, ":"],
10
+ 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],
15
20
  [:object_address, OBJECT_ID],
21
+ [:object_class, "Data"],
22
+ [:object_class, "Encoding"],
23
+ [:object_class, "StringIO"],
24
+ [:object_class, "StringIO"],
16
25
  [:object_description, " "],
17
- [:object_variable_prefix, "@"],
18
- [:object_variable, "string"],
19
- [:object_description, "="],
20
- [:open_string, "\""],
21
- [:string, "wirb"],
22
- [:close_string, "\""],
23
26
  [:object_description, " "],
24
- [:object_variable_prefix, "@"],
25
- [:object_variable, "append"],
26
- [:object_description, "="],
27
- [:false, "false"],
28
27
  [:object_description, " "],
29
- [:object_variable_prefix, "@"],
30
- [:object_variable, "readable"],
31
- [:object_description, "="],
32
- [:true, "true"],
33
28
  [:object_description, " "],
34
- [:object_variable_prefix, "@"],
35
- [:object_variable, "writable"],
36
- [:object_description, "="],
37
- [:true, "true"],
38
29
  [:object_description, " "],
39
- [:object_variable_prefix, "@"],
40
- [:object_variable, "pos"],
41
- [:object_description, "="],
42
- [:number, "0"],
43
30
  [:object_description, " "],
44
- [:object_variable_prefix, "@"],
45
- [:object_variable, "lineno"],
31
+ [:object_description, " "],
32
+ [:object_description, " @__data__="],
46
33
  [:object_description, "="],
47
- [:number, "0"],
48
- [:close_object, ">"],
34
+ [:object_description, "="],
35
+ [:object_description, "="],
36
+ [:object_description, "="],
37
+ [:object_description, "="],
38
+ [:object_description, "="],
39
+ [:object_description, "="],
40
+ [:object_description, "US-ASCII"],
41
+ [:object_description_prefix, ":"],
42
+ [:object_description_prefix, ":"],
43
+ [: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, "@"],
55
+ [:object_variable_prefix, "@"],
56
+ [:object_variable_prefix, "@"],
57
+ [:object_variable_prefix, "@"],
58
+ [:open_object, "#<"],
59
+ [:open_object, "#<"],
60
+ [:open_object, "#<"],
61
+ [:open_string, "\""],
62
+ [:string, "wirb"],
63
+ [:true, "true"],
64
+ [:true, "true"],
49
65
  ]
50
- =end
51
66
  else
52
67
  tokens.should be_like [
53
68
  [:open_object, "#<"],
@@ -58,7 +73,7 @@ describe tokenizer(__FILE__) do
58
73
  ]
59
74
  end
60
75
  end
61
-
76
+
62
77
  please do check Date.today
63
78
  tokens.should be_like [
64
79
  [:open_object, "#<"],
@@ -87,16 +87,22 @@ describe tokenizer(__FILE__) do
87
87
  ]
88
88
  end
89
89
  end
90
-
90
+
91
91
  please do check Module.new.singleton_class.singleton_class
92
92
  tokens.should be_like [
93
93
  [:open_object, "#<"],
94
94
  [:object_class, "Class"],
95
95
  [:object_description_prefix, ":"],
96
- [:object_description, '#<Class:#<Module:'],
96
+ [:open_object, "#<"],
97
+ [:object_class, "Class"],
98
+ [:object_description_prefix, ":"],
99
+ [:open_object, "#<"],
100
+ [:object_class, "Module"],
101
+ [:object_description_prefix, ":"],
97
102
  [:object_address, OBJECT_ID],
98
- [:object_description, '>>'],
99
- [:close_object, ">"]
103
+ [:close_object, ">"],
104
+ [:close_object, ">"],
105
+ [:close_object, ">"],
100
106
  ]
101
107
  end
102
108
  end
@@ -127,7 +133,7 @@ describe tokenizer(__FILE__) do
127
133
  @hallo = [1,42]
128
134
  end
129
135
  end
130
- check Hey.new
136
+ check Hey.new
131
137
  tokens.should be_like [
132
138
  [:open_object, "#<"],
133
139
  [:object_class, "Hey"],
@@ -68,13 +68,13 @@ describe tokenizer(__FILE__) do
68
68
  [:class_separator, "::"],
69
69
  [:object_class, "Dependency"],
70
70
  [:object_description_prefix, " "],
71
- [:object_description, "type=:development name="],
71
+ [:object_description, "type=:runtime name="],
72
72
  [:open_string, "\""],
73
- [:string, "rspec"],
73
+ [:string, "paint"],
74
74
  [:close_string, "\""],
75
75
  [:object_description, " requirements="],
76
76
  [:open_string, "\""],
77
- [:string, ">= 0"],
77
+ [:string, "~> 0.8"],
78
78
  [:close_string, "\""],
79
79
  [:close_object, ">"],
80
80
  ]
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  require 'rubygems' unless defined? Gem
3
3
  require File.dirname(__FILE__) + "/lib/wirb/version"
4
-
4
+
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "wirb"
7
7
  s.version = Wirb::VERSION.dup
@@ -15,14 +15,12 @@ Gem::Specification.new do |s|
15
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
16
  s.extra_rdoc_files = ["README.rdoc", "COPYING.txt"]
17
17
  s.license = 'MIT'
18
- s.add_development_dependency 'rspec'
19
- s.add_development_dependency 'rspec-core'
20
- s.add_development_dependency 'rake'
21
- s.add_development_dependency 'zucker', '>= 12.1'
18
+ s.add_dependency 'paint', '~> 0.8'
19
+ s.add_development_dependency 'rspec', '~> 2.14'
20
+ s.add_development_dependency 'rake', '~> 10.1'
21
+ s.add_development_dependency 'zucker', '~> 13'
22
22
  #s.add_development_dependency 'highline'
23
- # s.add_development_dependency 'debugger'
24
- s.add_dependency 'paint'
25
-
23
+
26
24
  len = s.homepage.size
27
25
  s.post_install_message = \
28
26
  (" ┌── " + "info ".ljust(len-2,'%') + "─┐\n" +
metadata CHANGED
@@ -1,96 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wirb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
5
- prerelease:
4
+ version: 1.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jan Lelis
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-08 00:00:00.000000000 Z
11
+ date: 2014-01-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: rspec
14
+ name: paint
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - '>='
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :development
19
+ version: '0.8'
20
+ type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - '>='
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0'
26
+ version: '0.8'
30
27
  - !ruby/object:Gem::Dependency
31
- name: rspec-core
28
+ name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - '>='
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
- version: '0'
33
+ version: '2.14'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - '>='
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
- version: '0'
40
+ version: '2.14'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - '>='
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0'
47
+ version: '10.1'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - '>='
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: '0'
54
+ version: '10.1'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: zucker
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - '>='
59
+ - - "~>"
68
60
  - !ruby/object:Gem::Version
69
- version: '12.1'
61
+ version: '13'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - '>='
76
- - !ruby/object:Gem::Version
77
- version: '12.1'
78
- - !ruby/object:Gem::Dependency
79
- name: paint
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
65
  requirements:
83
- - - '>='
66
+ - - "~>"
84
67
  - !ruby/object:Gem::Version
85
- version: '0'
86
- type: :runtime
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
68
+ version: '13'
94
69
  description: 'Wavy IRB: Colorizes irb results. It originated from Wirble, but only
95
70
  provides result highlighting. Just call Wirb.start and enjoy the colors in your
96
71
  IRB ;). You can use it with your favorite colorizer engine. See README.rdoc for
@@ -102,54 +77,55 @@ extra_rdoc_files:
102
77
  - README.rdoc
103
78
  - COPYING.txt
104
79
  files:
105
- - lib/wirb/version.rb
106
- - lib/wirb/irb.rb
107
- - lib/wirb/tokenizer.rb
108
- - lib/wirb/colorizer/wirb0_highline.rb
80
+ - ".gemtest"
81
+ - CHANGELOG.rdoc
82
+ - COPYING.txt
83
+ - README.rdoc
84
+ - Rakefile
85
+ - data/wirb/classic_paint.yml
86
+ - data/wirb/classic_wirb0.yml
87
+ - data/wirb/colorless.yml
88
+ - lib/wirb.rb
89
+ - lib/wirb/colorizer.rb
109
90
  - lib/wirb/colorizer/highline.rb
110
- - lib/wirb/colorizer/wirble.rb
111
- - lib/wirb/colorizer/wirb0.rb
112
91
  - lib/wirb/colorizer/paint.rb
92
+ - lib/wirb/colorizer/wirb0.rb
93
+ - lib/wirb/colorizer/wirb0_highline.rb
113
94
  - lib/wirb/colorizer/wirb0_paint.rb
95
+ - lib/wirb/colorizer/wirble.rb
96
+ - lib/wirb/irb.rb
97
+ - lib/wirb/tokenizer.rb
98
+ - lib/wirb/version.rb
114
99
  - lib/wirb/wp.rb
115
- - lib/wirb/colorizer.rb
116
- - lib/wirb.rb
117
- - spec/tokenizer_string_spec.rb
118
- - spec/tokenizer_misc_spec.rb
119
- - spec/tokenizer_symbol_spec.rb
100
+ - spec/colorizer_highline_spec.rb
120
101
  - spec/colorizer_paint_spec.rb
121
- - spec/tokenizer_object_spec.rb
122
- - spec/colorizer_wirb0_spec.rb
123
- - spec/tokenizer_enumerator_spec.rb
124
102
  - spec/colorizer_spec.rb
125
- - spec/tokenizer_nil_false_true_spec.rb
126
- - spec/spec_helper.rb
127
- - spec/tokenizer_regexp_spec.rb
128
- - spec/tokenizer_rails_spec.rb
129
- - spec/tokenizer_set_spec.rb
130
- - spec/tokenizer_hash_spec.rb
131
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
+ - spec/spec_helper.rb
132
108
  - spec/tokenizer_array_spec.rb
109
+ - spec/tokenizer_enumerator_spec.rb
110
+ - spec/tokenizer_hash_spec.rb
111
+ - spec/tokenizer_misc_spec.rb
133
112
  - spec/tokenizer_nested_spec.rb
134
- - spec/colorizer_wirble_spec.rb
135
- - spec/colorizer_highline_spec.rb
113
+ - spec/tokenizer_nil_false_true_spec.rb
136
114
  - spec/tokenizer_number_spec.rb
137
- - spec/colorizer_wirb0_paint_spec.rb
115
+ - spec/tokenizer_object_spec.rb
116
+ - spec/tokenizer_rails_spec.rb
117
+ - spec/tokenizer_regexp_spec.rb
138
118
  - spec/tokenizer_rubygems_spec.rb
139
119
  - spec/tokenizer_rubyvm_spec.rb
120
+ - spec/tokenizer_set_spec.rb
121
+ - spec/tokenizer_string_spec.rb
122
+ - spec/tokenizer_symbol_spec.rb
140
123
  - spec/tokenizer_time_spec.rb
141
- - COPYING.txt
142
- - README.rdoc
143
- - CHANGELOG.rdoc
144
- - data/wirb/classic_wirb0.yml
145
- - data/wirb/classic_paint.yml
146
- - data/wirb/colorless.yml
147
- - Rakefile
148
124
  - wirb.gemspec
149
- - .gemtest
150
125
  homepage: https://github.com/janlelis/wirb
151
126
  licenses:
152
127
  - MIT
128
+ metadata: {}
153
129
  post_install_message: |2-
154
130
  ┌── info ──────────────────────────┐
155
131
  J-_-L │ https://github.com/janlelis/wirb │
@@ -161,21 +137,19 @@ rdoc_options: []
161
137
  require_paths:
162
138
  - lib
163
139
  required_ruby_version: !ruby/object:Gem::Requirement
164
- none: false
165
140
  requirements:
166
- - - '>='
141
+ - - ">="
167
142
  - !ruby/object:Gem::Version
168
143
  version: 1.8.7
169
144
  required_rubygems_version: !ruby/object:Gem::Requirement
170
- none: false
171
145
  requirements:
172
- - - '>='
146
+ - - ">="
173
147
  - !ruby/object:Gem::Version
174
148
  version: 1.3.6
175
149
  requirements: []
176
150
  rubyforge_project:
177
- rubygems_version: 1.8.26
151
+ rubygems_version: 2.2.0
178
152
  signing_key:
179
- specification_version: 3
153
+ specification_version: 4
180
154
  summary: 'Wavy IRB: Colorizes irb results.'
181
155
  test_files: []