wirb 2.1.0 → 2.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5aa1b145bd66701a8ead0252b2be8415f2f9bcbc
4
- data.tar.gz: f5b4097bcb145cf9b68c39a1f219a51084297b76
2
+ SHA256:
3
+ metadata.gz: 5bb7682a36323e7f6091949c181a0d0dba6749959d8fe8722786c78f68b4b965
4
+ data.tar.gz: b09786d2784b0bfffa33a2106537a756ae442b79495accfe5038e42ca6e0573d
5
5
  SHA512:
6
- metadata.gz: c431f78171be2217d2e17ac2a5f0dd649752d9dbd14e540f10b83ea6418ff735288c931ea5e3d7c699204a6c2edc0d327250925a4f443c3cb401c4f6b0ccd602
7
- data.tar.gz: 1e725e28a73953fcd6313c1667667873a132b24a2a8b5fe0f1a3ff14c8feb242ae031e1b8bbcddfa79a8e3028d16ca3f62f771cf650f079ac237c9ac9207b73d
6
+ metadata.gz: cde9e32b55bdcb44d9f8b39211198aa426ef7c23b0e95bea38dddf0cbd6ea2a13531a07687f753a32201dd91f6eeed5d18ded3dd9e9df27892e5530fc92a38f9
7
+ data.tar.gz: 387112604206f5727d2df2689efc2077e642eefc467242523f1b7caa12d6d3f1bfd7683b88acc90de6eb4716c4453c3770593d4cd7200c3fc8783da740b302f5
@@ -1,3 +1,18 @@
1
+ ## 2.2.2
2
+ * Relax Ruby version requirement to allow 3.0
3
+
4
+ ## 2.2.1
5
+ * Fix new timestamp matching
6
+
7
+ ## 2.2.0
8
+ * Support Ruby 2.7
9
+
10
+ ## 2.1.2
11
+ * Fix Gem.datadir deprecation
12
+
13
+ ## 2.1.1
14
+ * Relax paint dependency (allow paint versions >= 2.0)
15
+
1
16
  ## 2.1.0
2
17
  * New color schema: ultra
3
18
 
@@ -1,4 +1,4 @@
1
- Copyright (C) 2011-2015 Jan Lelis <mail@janlelis.de>
1
+ Copyright (C) 2011-2020 Jan Lelis <https://janlelis.com>
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
data/README.md CHANGED
@@ -1,23 +1,20 @@
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)
1
+ ## WIRB Interactive Ruby [![version](https://badge.fury.io/rb/wirb.svg)](https://badge.fury.io/rb/wirb) [<img src="https://github.com/janlelis/wirb/workflows/Test/badge.svg" />](https://github.com/janlelis/wirb/actions?query=workflow%3ATest)
2
2
 
3
- **WIRB** syntax highlights Ruby objects.
3
+ The **WIRB** gem syntax highlights Ruby objects. Works best as your default REPL inspector (see usage section below), but does not require IRB.
4
4
 
5
- Supported Rubies: 2.3, 2.2, 2.1, 2.0, jruby, rubinius.
5
+ Supported Rubies: 3.0, 2.7, 2.6, 2.5
6
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)
7
+ Older Rubies, should work: 2.4, 2.3, 2.2, 2.1, 2.0, rubinius
10
8
 
9
+ Ancient Rubies (1.9, 1.8): Please use [WIRB 1.0](https://github.com/janlelis/wirb/tree/1.0.3)
11
10
 
12
11
  ## Features
13
12
 
14
- * Syntax highlighting for Ruby objects
13
+ * Syntax highlighting for inspected Ruby objects
15
14
  * 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
15
+ * Support for generic objects, especially enumerators, and nested generic objects
16
+ * Supports common standard library objects, like `Set`
17
+ * Color schemas customizable via YAML
21
18
 
22
19
  ## Install
23
20
 
@@ -25,56 +22,54 @@ Install the gem with:
25
22
 
26
23
  $ gem install wirb
27
24
 
25
+ Or add it to your Gemfile:
26
+
27
+ gem 'wirb'
28
+
28
29
  ## Usage
29
30
 
30
31
  To start IRB with WIRB activated for one session, do:
31
32
 
32
33
  $ irb -r wirb --inspect wirb
33
34
 
34
- To activate WIRB permanently, you'll need to add this to the `~/.irbrc` file:
35
+ To activate WIRB permanently, you can add this to the `~/.irbrc` file:
35
36
 
36
37
  require 'wirb'
37
38
  Wirb.start
38
39
 
40
+ Another way would be to use [Irbtools](https://irb.tools), which activate WIRB automatically.
41
+
42
+ ## `Kernel#wp`
43
+
44
+ WIRB comes with a pretty printing utility (similar to awesome_print):
45
+
46
+ require 'wirb/wp'
47
+ wp some_object
48
+
39
49
  ### Bundled Schemas
40
50
 
41
- These are the bundled color schemas. You can load one with `Wirb.load_schema
42
- :name`
51
+ These are the bundled color schemas. You can load one with `Wirb.load_schema(:name)`
43
52
 
44
53
  * `:classic` (default)
45
54
  * `:colorless` (only uses :bright, :underline and :inverse effect)
46
- * `:ultra` (matches the colorscheme from
47
- [Ultra](https://github.com/venantius/ultra) over in Clojure-land)
55
+ * `:ultra` (by @venantius, matches the colorscheme from [Ultra](https://github.com/venantius/ultra) over in Clojure-land)
48
56
 
49
57
  ### Usage with Rails
50
58
 
51
- See [the solution in this issue](https://github.com/janlelis/wirb/issues/12#issuecomment-249492524).
52
-
53
- ## `Kernel#wp`
54
-
55
- You can use WIRB like awesome_print to highlight any objects using `wp`:
56
-
57
- require 'wirb/wp'
58
- wp some_object
59
+ If you run into problems using WIRB with Rails, try [the solution in this issue](https://github.com/janlelis/wirb/issues/12#issuecomment-249492524).
59
60
 
60
61
  ## Also See
61
62
 
62
63
  * Gem that allows you to configure views for specific objects:
63
64
  [hirb](https://github.com/cldwalker/hirb)
64
- * WIRB is part of: [irbtools](https://github.com/janlelis/irbtools)
65
- * RIPL is an IRB alternative, syntax highlighting plugin (uses wirb by
66
- default):
67
- [ripl-color_result](https://github.com/janlelis/ripl-color_result)
65
+ * WIRB is part of: [Irbtools](https://github.com/janlelis/irbtools)
68
66
  * More about terminal colors: [Paint](https://github.com/janlelis/paint)
69
- * [Wirble](http://pablotron.org/software/wirble/): WIRB's predecessor
70
-
71
67
 
72
68
  ## Credits
73
69
 
74
- Copyright (c) 2011-2015 Jan Lelis <http://janlelis.com> see COPYING for
75
- details.
70
+ Copyright (c) 2011-2020 Jan Lelis <https://janlelis.com> see COPYING for details.
76
71
 
77
- Influenced by code from: Copyright (C) 2006-2009 Paul Duncan
78
- <pabs@pablotron.org>
72
+ First tokenizer version was based on the [wirble](https://rubygems.org/gems/wirble) gem:
73
+ Copyright (C) 2006-2009 Paul Duncan <pabs@pablotron.org>
79
74
 
80
75
  [All contributors](https://github.com/janlelis/wirb/contributors)
data/Rakefile CHANGED
@@ -1,14 +1,12 @@
1
1
  require 'rake'
2
2
  require 'fileutils'
3
- require "rspec/core/rake_task"
3
+
4
4
  task :default => :spec
5
5
  task :test => :spec
6
6
 
7
- RSpec::Core::RakeTask.new(:spec) do |t|
8
- t.rspec_opts = [
9
- '--color',
10
- '-r ' + File.expand_path( File.join( 'spec', 'spec_helper') ),
11
- ]
7
+ desc "Run tests"
8
+ task :spec do
9
+ sh "rspec"
12
10
  end
13
11
 
14
12
  def gemspec
@@ -24,7 +22,7 @@ end
24
22
 
25
23
  desc "Install the gem locally"
26
24
  task :install => :gem do
27
- sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}.gem --no-rdoc --no-ri}
25
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}.gem --no-doc}
28
26
  end
29
27
 
30
28
  desc "Generate the gemspec"
@@ -14,7 +14,8 @@ module Wirb
14
14
 
15
15
  def self.resolve_schema_yaml(yaml_path)
16
16
  if yaml_path.is_a? Symbol # bundled themes
17
- [yaml_path.to_s, YAML.load_file(File.join(Gem.datadir('wirb'), "#{yaml_path}.yml"))]
17
+ datadir = Gem.loaded_specs['wirb'].datadir
18
+ [yaml_path.to_s, YAML.load_file(File.join(datadir, "#{yaml_path}.yml"))]
18
19
  else
19
20
  [File.basename(yaml_path).gsub(/\.yml$/, ''), YAML.load_file(yaml_path)]
20
21
  end
@@ -239,7 +239,7 @@ module Wirb
239
239
  when :time # via regex, state needs to be triggered somewhere else
240
240
  peek = chars[i..-1].join
241
241
  if [
242
- /^\d+-\d{2}-\d{2} \d{2}:\d{2}:\d{2} (?:[+-]\d{4}|[a-z]{3})/i, # 1.9 / UTC
242
+ /^\d+-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d{,9})? (?:[+-]\d{4}|[a-z]{3})/i,
243
243
  ].any?{ |regex|
244
244
  ( @token + peek ) =~ regex
245
245
  } # found, adjust parsing-pointer:
@@ -400,10 +400,10 @@ module Wirb
400
400
  if c =~ /[x0-9a-f]/
401
401
  @token << c
402
402
  else
403
- if c == '@'
403
+ if c == '@' || c == ' ' && nc != "@"
404
404
  pass_state[:remove]
405
405
  push_state[:object_line]
406
- pass[:object_line_prefix, '@']
406
+ pass[:object_line_prefix, c]
407
407
  else
408
408
  pass_state[:remove, :repeat]
409
409
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Wirb
2
- VERSION = '2.1.0'.freeze
4
+ VERSION = '2.2.2'
3
5
  end
@@ -79,31 +79,6 @@ describe tokenizer(__FILE__) do
79
79
  ]
80
80
  end
81
81
 
82
- =begin
83
- only18 do
84
- please do check Rational(2,3)
85
- tokens.should == [
86
- [:class, "Rational"],
87
- [:open_rational, "("],
88
- [:number, "2"],
89
- [:rational_separator, ","],
90
- [:whitespace, " "],
91
- [:number, "3"],
92
- [:close_rational, ")"],
93
- ]
94
-
95
- # modifying the world, see https://github.com/janlelis/wirb/issues#issue/1
96
- require 'mathn'
97
- check Rational(2,3)
98
- tokens.should == [
99
- [:number, "2"],
100
- [:rational_separator, "/"],
101
- [:number, "3"],
102
- ]
103
- end
104
- end
105
- =end
106
-
107
82
  please do check (1/0.0)
108
83
  tokens.should == [
109
84
  [:special_number, "Infinity"],
@@ -11,33 +11,60 @@ describe tokenizer(__FILE__) do
11
11
  [:object_address, OBJECT_ID],
12
12
  [:close_object, ">"],
13
13
  ]
14
- end
14
+ end
15
15
 
16
16
  please do check proc{}
17
- tokens.should be_like [
18
- [:open_object, "#<"],
19
- [:object_class, "Proc"],
20
- [:object_description_prefix, ":"],
21
- [:object_address, OBJECT_ID],
22
- [:object_line_prefix, "@"],
23
- [:object_line, /.*tokenizer_object_spec.rb:/],
24
- [:object_line_number, /\d+/],
25
- [:close_object, ">"],
26
- ]
17
+ if RUBY_VERSION >= "2.7"
18
+ tokens.should be_like [
19
+ [:open_object, "#<"],
20
+ [:object_class, "Proc"],
21
+ [:object_description_prefix, ":"],
22
+ [:object_address, OBJECT_ID],
23
+ [:object_line_prefix, " "], # changed in 2.7
24
+ [:object_line, /.*tokenizer_object_spec.rb:/],
25
+ [:object_line_number, /\d+/],
26
+ [:close_object, ">"],
27
+ ]
28
+ else
29
+ tokens.should be_like [
30
+ [:open_object, "#<"],
31
+ [:object_class, "Proc"],
32
+ [:object_description_prefix, ":"],
33
+ [:object_address, OBJECT_ID],
34
+ [:object_line_prefix, "@"],
35
+ [:object_line, /.*tokenizer_object_spec.rb:/],
36
+ [:object_line_number, /\d+/],
37
+ [:close_object, ">"],
38
+ ]
39
+ end
27
40
  end
28
41
 
29
42
  please do check lambda{}
30
- tokens.should be_like [
31
- [:open_object, "#<"],
32
- [:object_class, "Proc"],
33
- [:object_description_prefix, ":"],
34
- [:object_address, OBJECT_ID],
35
- [:object_line_prefix, "@"],
36
- [:object_line, /.*tokenizer_object_spec.rb:/],
37
- [:object_line_number, /\d+/],
38
- [:object_description, " (lambda)"],
39
- [:close_object, ">"],
40
- ]
43
+ if RUBY_VERSION >= "2.7"
44
+ tokens.should be_like [
45
+ [:open_object, "#<"],
46
+ [:object_class, "Proc"],
47
+ [:object_description_prefix, ":"],
48
+ [:object_address, OBJECT_ID],
49
+ [:object_line_prefix, " "], # changed in 2.7
50
+ [:object_line, /.*tokenizer_object_spec.rb:/],
51
+ [:object_line_number, /\d+/],
52
+ [:object_description, " (lambda)"],
53
+ [:close_object, ">"],
54
+ ]
55
+ else
56
+ tokens.should be_like [
57
+ [:open_object, "#<"],
58
+ [:object_class, "Proc"],
59
+ [:object_description_prefix, ":"],
60
+ [:object_address, OBJECT_ID],
61
+ [:object_line_prefix, "@"],
62
+ [:object_line, /.*tokenizer_object_spec.rb:/],
63
+ [:object_line_number, /\d+/],
64
+ [:object_description, " (lambda)"],
65
+ [:close_object, ">"],
66
+ ]
67
+ end
41
68
  end
42
69
 
43
70
  please do check StringScanner.new('wirb')
@@ -1,14 +1,17 @@
1
1
  describe tokenizer(__FILE__) do
2
2
  after :each do check_value end
3
3
 
4
- please do now = Time.now
5
- check [Time.now, Time.now]
4
+
5
+ please do
6
+ now = Time.now
7
+ now2 = Time.now
8
+ check [now, now2]
6
9
  tokens.should == [
7
10
  [:open_array, "["],
8
- [:time, now.to_s],
11
+ [:time, now.inspect],
9
12
  [:comma, ","],
10
13
  [:whitespace, " "],
11
- [:time, now.to_s],
14
+ [:time, now2.inspect],
12
15
  [:close_array, "]"],
13
16
  ]
14
17
  end
@@ -5,16 +5,16 @@ Gem::Specification.new do |s|
5
5
  s.name = "wirb"
6
6
  s.version = Wirb::VERSION.dup
7
7
  s.authors = ["Jan Lelis"]
8
- s.email = "mail@janlelis.de"
8
+ s.email = ["hi@ruby.consulting"]
9
9
  s.homepage = "https://github.com/janlelis/wirb"
10
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'
11
+ s.description = "WIRB syntax highlights inspected Ruby objects"
12
+ s.required_ruby_version = '>= 2.0', '< 4.0'
13
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
14
  s.extra_rdoc_files = ["README.md", "CHANGELOG.md", "COPYING.txt"]
15
15
  s.license = 'MIT'
16
- s.add_dependency 'paint', '>= 0.9', '< 2.0'
16
+ s.add_dependency 'paint', '>= 0.9', '< 3.0'
17
17
  s.add_development_dependency 'rspec', '~> 2.14'
18
- s.add_development_dependency 'rake', '~> 10.4'
18
+ s.add_development_dependency 'rake', '~> 13.0'
19
19
  s.add_development_dependency 'ruby_engine', '~> 1.0'
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wirb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-08 00:00:00.000000000 Z
11
+ date: 2020-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paint
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.9'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '2.0'
22
+ version: '3.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.9'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '2.0'
32
+ version: '3.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rspec
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '10.4'
53
+ version: '13.0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '10.4'
60
+ version: '13.0'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: ruby_engine
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -72,9 +72,9 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
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.
77
- email: mail@janlelis.de
75
+ description: WIRB syntax highlights inspected Ruby objects
76
+ email:
77
+ - hi@ruby.consulting
78
78
  executables: []
79
79
  extensions: []
80
80
  extra_rdoc_files:
@@ -124,17 +124,19 @@ require_paths:
124
124
  - lib
125
125
  required_ruby_version: !ruby/object:Gem::Requirement
126
126
  requirements:
127
- - - "~>"
127
+ - - ">="
128
128
  - !ruby/object:Gem::Version
129
129
  version: '2.0'
130
+ - - "<"
131
+ - !ruby/object:Gem::Version
132
+ version: '4.0'
130
133
  required_rubygems_version: !ruby/object:Gem::Requirement
131
134
  requirements:
132
135
  - - ">="
133
136
  - !ruby/object:Gem::Version
134
137
  version: '0'
135
138
  requirements: []
136
- rubyforge_project:
137
- rubygems_version: 2.4.8
139
+ rubygems_version: 3.1.2
138
140
  signing_key:
139
141
  specification_version: 4
140
142
  summary: WIRB Interactive Ruby