wirb 2.1.2 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fa4212d9825d960bdf22a8e396d234ff6de8b58b
4
- data.tar.gz: e57f146a8391abfc88a21c8bdaa48ac242ed4a87
2
+ SHA256:
3
+ metadata.gz: 293a875ed373424e89b76a22b96723e1df4ba35e68a028f118e438502d59480e
4
+ data.tar.gz: debad98d10d276d8fcee37d7bcfa4f49e1a6479bce7f28dc6ab88c5ca0f6cbf7
5
5
  SHA512:
6
- metadata.gz: 7a0cb45671ed46005f6d5e97a1753dd0ccd0265f9a73a78c8cb2feafb210a7c2568795147bc0bc994987ea1184b1992f1175867f8663b464df411bc0448db022
7
- data.tar.gz: 9f5c936e35f807d876882ee414b98fe473b5dec090161bf213c1289abf4ce46e3e48cf9f47b523ecbeef1d763264f7b451e598bb539e03e9bcb4181bd3f6bd15
6
+ metadata.gz: bd7fceb6f837102d67e7979fb5f2dd2eb64b9c6bc538fed61891e634085e55fa0887a963cd149d3d55f892429889329fcc97f322c8d562b791a774f16b4c0928
7
+ data.tar.gz: dfa90dbb9e5b8a079d5a522e7ecc49ba52e89d02a469813198e97a569e62ce93d7a530531bf722a101292e67cc06e3ac299167277c00550a63fed13b4cae5619
@@ -1,3 +1,6 @@
1
+ ## 2.2.0
2
+ * Support Ruby 2.7
3
+
1
4
  ## 2.1.2
2
5
  * Fix Gem.datadir deprecation
3
6
 
@@ -1,4 +1,4 @@
1
- Copyright (C) 2011-2017 Jan Lelis <mail@janlelis.de>
1
+ Copyright (C) 2011-2019 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
data/README.md CHANGED
@@ -1,23 +1,23 @@
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://travis-ci.org/janlelis/wirb.png" />](https://travis-ci.org/janlelis/wirb)
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.4, 2.3, 2.2, 2.1, 2.0, jruby, rubinius.
5
+ Supported Rubies: 2.7, 2.6, 2.5, 2.4
6
6
 
7
- Legacy Rubies (1.9, 1.8): Use [WIRB 1.0](https://github.com/janlelis/wirb/tree/1.0.3)
7
+ Older Rubies, should work: 2.3, 2.2, 2.1, 2.0, rubinius
8
8
 
9
- [Example output](https://travis-ci.org/janlelis/wirb/jobs/56299603)
9
+ Ancient Rubies (1.9, 1.8): Please use [WIRB 1.0](https://github.com/janlelis/wirb/tree/1.0.3)
10
+
11
+ [See it in action](https://travis-ci.org/janlelis/wirb/jobs/56299603)
10
12
 
11
13
 
12
14
  ## Features
13
15
 
14
- * Syntax highlighting for Ruby objects
16
+ * Syntax highlighting for inspected Ruby objects
15
17
  * 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
18
+ * Support for generic objects, especially enumerators, and nested generic objects
19
+ * Supports common standard library objects, like `Set`
20
+ * Color schemas customizable via YAML
21
21
 
22
22
  ## Install
23
23
 
@@ -25,56 +25,54 @@ Install the gem with:
25
25
 
26
26
  $ gem install wirb
27
27
 
28
+ Or add it to your Gemfile:
29
+
30
+ gem 'wirb'
31
+
28
32
  ## Usage
29
33
 
30
34
  To start IRB with WIRB activated for one session, do:
31
35
 
32
36
  $ irb -r wirb --inspect wirb
33
37
 
34
- To activate WIRB permanently, you'll need to add this to the `~/.irbrc` file:
38
+ To activate WIRB permanently, you can add this to the `~/.irbrc` file:
35
39
 
36
40
  require 'wirb'
37
41
  Wirb.start
38
42
 
43
+ Another way would be to use [Irbtools](https://irb.tools), which activate WIRB automatically.
44
+
45
+ ## `Kernel#wp`
46
+
47
+ WIRB comes with a pretty printing utility (similar to awesome_print):
48
+
49
+ require 'wirb/wp'
50
+ wp some_object
51
+
39
52
  ### Bundled Schemas
40
53
 
41
- These are the bundled color schemas. You can load one with `Wirb.load_schema
42
- :name`
54
+ These are the bundled color schemas. You can load one with `Wirb.load_schema(:name)`
43
55
 
44
56
  * `:classic` (default)
45
57
  * `: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)
58
+ * `:ultra` (by @venantius, matches the colorscheme from [Ultra](https://github.com/venantius/ultra) over in Clojure-land)
48
59
 
49
60
  ### Usage with Rails
50
61
 
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
62
+ 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
63
 
60
64
  ## Also See
61
65
 
62
66
  * Gem that allows you to configure views for specific objects:
63
67
  [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)
68
+ * WIRB is part of: [Irbtools](https://github.com/janlelis/irbtools)
68
69
  * More about terminal colors: [Paint](https://github.com/janlelis/paint)
69
- * [Wirble](https://rubygems.org/gems/wirble): WIRB's predecessor
70
-
71
70
 
72
71
  ## Credits
73
72
 
74
- Copyright (c) 2011-2017 Jan Lelis <http://janlelis.com> see COPYING for
75
- details.
73
+ Copyright (c) 2011-2019 Jan Lelis <https://janlelis.com> see COPYING for details.
76
74
 
77
- Influenced by code from: Copyright (C) 2006-2009 Paul Duncan
78
- <pabs@pablotron.org>
75
+ First tokenizer version was based on the [wirble](https://rubygems.org/gems/wirble) gem:
76
+ Copyright (C) 2006-2009 Paul Duncan <pabs@pablotron.org>
79
77
 
80
78
  [All contributors](https://github.com/janlelis/wirb/contributors)
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}.gem --no-rdoc --no-ri}
27
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}.gem --no-doc}
28
28
  end
29
29
 
30
30
  desc "Generate the gemspec"
@@ -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.2'.freeze
4
+ VERSION = '2.2.0'
3
5
  end
@@ -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
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.2
4
+ version: 2.2.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: 2017-12-08 00:00:00.000000000 Z
11
+ date: 2019-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paint
@@ -133,8 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubyforge_project:
137
- rubygems_version: 2.6.13
136
+ rubygems_version: 3.0.6
138
137
  signing_key:
139
138
  specification_version: 4
140
139
  summary: WIRB Interactive Ruby