object_inspector 0.6.2 → 0.7.0

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.
data/CHANGELOG.md DELETED
@@ -1,49 +0,0 @@
1
- ### 0.6.2 - 2022-12-30
2
- - Internal spruce-up for Ruby 3.2. No outward-facing changes.
3
- - Remove travis-ci config since travis-ci is no longer in use.
4
-
5
- ### 0.6.1 - 2019-06-27
6
- - Flatten and compact arrays of `nil`s as well as nested arrays of `nil`s in join_* methods.
7
-
8
- ### 0.6.0 - 2019-03-13
9
- - Fix inspection of delegating wrapper objects.
10
- - Allow clearing output of inspect methods.
11
-
12
- ### 0.5.2 - 2019-02-24
13
- - Automatically compact nils in join_* methods.
14
-
15
- ### 0.5.1 - 2018-06-12
16
- - Don't include empty strings from Scope#join_* methods when applicable.
17
-
18
- ### 0.5.0 - 2018-06-11
19
- - Add `inspect_issues` to ObjectInspector::TemplatingFormatter.
20
- - Add ObjectInspector::Scope#join_name.
21
- - Add configurable ObjectInspector.configuration.presented_object_separator.
22
-
23
- ### 0.4.0 - 2018-05-25
24
- - Feature: Add ObjectInspector::Configuration#default_scope setting -- can be used to override the default Scope for object inspection.
25
- - Implement ObjectInspector::Scope#== for comparing scopes with scopes and/or scopes with (Arrays of) Strings, Symbols, etc.
26
-
27
- ### 0.3.1 - 2018-04-15
28
- - Add ObjectInspector::Configuration#formatter_class setting for overriding the default Formatter.
29
-
30
- ### 0.3.0 - 2018-04-14
31
- - Remove optional dependency on ActiveSupport::StringInquirer. [Scopes are now objects](https://github.com/pdobb/object_inspector/blob/master/lib/object_inspector/scope.rb) that act like ActiveSupport::StringInquirer objects.
32
- - Add ObjectInspector::Scope.join_flags helper method.
33
- - Add ObjectInspector::Scope.join_info helper method.
34
- - Scope: Show an out-of-scope-placeholder symbol (*) when predicate is not matched and a block is given.
35
- - Scope: Add wild-card "all" scope that is always evaluated as true / a match.
36
- - Add ability to specify multiple scopes. e.g. my_object.inspect(scope: %i[verbose complex]).
37
- - Add gem defaults configuration.
38
-
39
- ### 0.2.0 - 2018-04-12
40
- - Automatically inspect wrapped Objects, if applicable.
41
- - Use `display_name` if defined on object, in place of `inspect_name`.
42
- - Add on-the-fly inspect methods when Symbols are passed in to #inspect.
43
- - Update the `flags` and `info` demarcation symbols.
44
- - Add ObjectInspector::TemplatingFormatter, and use it as the new default since it's faster.
45
- - Rename ObjectInspector::DefaultFormatter to ObjectInspector::CombiningFormatter.
46
-
47
-
48
- ### 0.1.0 - 2018-04-09
49
- - Initial release!
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
-
7
- # Specify your gem's dependencies in object_inspector.gemspec
8
- gemspec
data/Gemfile.lock DELETED
@@ -1,83 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- object_inspector (0.6.2)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- ansi (1.5.0)
10
- ast (2.4.2)
11
- benchmark-ips (2.10.0)
12
- builder (3.2.4)
13
- byebug (11.1.3)
14
- coderay (1.1.3)
15
- docile (1.4.0)
16
- json (2.6.3)
17
- kwalify (0.7.2)
18
- method_source (1.0.0)
19
- minitest (5.16.3)
20
- minitest-reporters (1.5.0)
21
- ansi
22
- builder
23
- minitest (>= 5.0)
24
- ruby-progressbar
25
- object_identifier (0.4.1)
26
- parallel (1.22.1)
27
- parser (3.1.3.0)
28
- ast (~> 2.4.1)
29
- pry (0.14.1)
30
- coderay (~> 1.1)
31
- method_source (~> 1.0)
32
- pry-byebug (3.10.1)
33
- byebug (~> 11.0)
34
- pry (>= 0.13, < 0.15)
35
- rainbow (3.1.1)
36
- rake (13.0.6)
37
- reek (6.1.3)
38
- kwalify (~> 0.7.0)
39
- parser (~> 3.1.0)
40
- rainbow (>= 2.0, < 4.0)
41
- regexp_parser (2.6.1)
42
- rexml (3.2.5)
43
- rubocop (1.41.1)
44
- json (~> 2.3)
45
- parallel (~> 1.10)
46
- parser (>= 3.1.2.1)
47
- rainbow (>= 2.2.2, < 4.0)
48
- regexp_parser (>= 1.8, < 3.0)
49
- rexml (>= 3.2.5, < 4.0)
50
- rubocop-ast (>= 1.23.0, < 2.0)
51
- ruby-progressbar (~> 1.7)
52
- unicode-display_width (>= 1.4.0, < 3.0)
53
- rubocop-ast (1.24.1)
54
- parser (>= 3.1.1.0)
55
- ruby-progressbar (1.11.0)
56
- simplecov (0.22.0)
57
- docile (~> 1.1)
58
- simplecov-html (~> 0.11)
59
- simplecov_json_formatter (~> 0.1)
60
- simplecov-html (0.12.3)
61
- simplecov_json_formatter (0.1.4)
62
- unicode-display_width (2.3.0)
63
-
64
- PLATFORMS
65
- ruby
66
-
67
- DEPENDENCIES
68
- benchmark-ips
69
- bundler
70
- byebug
71
- minitest
72
- minitest-reporters
73
- object_identifier
74
- object_inspector!
75
- pry
76
- pry-byebug
77
- rake
78
- reek
79
- rubocop
80
- simplecov
81
-
82
- BUNDLED WITH
83
- 2.4.1
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rake/testtask"
5
-
6
- Rake::TestTask.new(:test) do |t|
7
- t.libs << "test"
8
- t.libs << "lib"
9
- t.test_files = FileList["test/**/*_test.rb"]
10
- end
11
-
12
- task default: :test
data/bin/console DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "bundler/setup"
5
- require "object_inspector"
6
- require "object_identifier"
7
- require "ostruct"
8
-
9
- # You can add fixtures and/or initialization code here to make experimenting
10
- # with your gem easier. You can also use a different console, if you like.
11
-
12
- require "pry"
13
- Pry.start
14
-
15
- # require "irb"
16
- # IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = File.expand_path("../lib", __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require "object_inspector/version"
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = "object_inspector"
9
- spec.version = ObjectInspector::VERSION
10
- spec.authors = ["Paul DobbinSchmaltz"]
11
- spec.email = ["p.dobbinschmaltz@icloud.com"]
12
-
13
- spec.summary = "ObjectInspector builds uniformly formatted inspect output with customizable amounts of detail."
14
- spec.description = "ObjectInspector takes Object#inspect to the next level. Specify any combination of identification attributes, flags, issues, info, and/or a name along with an optional, self-definable scope option to represents objects. Great for the console, logging, etc."
15
- spec.homepage = "https://github.com/pdobb/object_inspector"
16
- spec.license = "MIT"
17
-
18
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
- # to allow pushing to a single host or delete this section to allow pushing to any host.
20
- # if spec.respond_to?(:metadata)
21
- # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
22
- # else
23
- # raise "RubyGems 2.0 or newer is required to protect against " \
24
- # "public gem pushes."
25
- # end
26
-
27
- spec.files =
28
- `git ls-files -z`.split("\x0").reject do |f|
29
- f.match(%r{^(test|spec|features)/})
30
- end
31
- spec.bindir = "exe"
32
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
- spec.require_paths = ["lib"]
34
-
35
- spec.add_development_dependency "benchmark-ips"
36
- spec.add_development_dependency "bundler"
37
- spec.add_development_dependency "byebug"
38
- spec.add_development_dependency "minitest"
39
- spec.add_development_dependency "minitest-reporters"
40
- spec.add_development_dependency "object_identifier"
41
- spec.add_development_dependency "pry"
42
- spec.add_development_dependency "pry-byebug"
43
- spec.add_development_dependency "rake"
44
- spec.add_development_dependency "reek"
45
- spec.add_development_dependency "rubocop"
46
- spec.add_development_dependency "simplecov"
47
- end
@@ -1,118 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Play from the console with:
4
- # play scripts/benchmarking/formatters.rb
5
-
6
- require "ostruct"
7
- require "benchmark/ips"
8
-
9
- custom_formatter_klasses ||= []
10
-
11
- formatter_klasses = [
12
- ObjectInspector::TemplatingFormatter,
13
- ObjectInspector::CombiningFormatter,
14
- *Array(custom_formatter_klasses)
15
- ]
16
-
17
- INSPECTOR_WITH_FLAGS_AND_INFO_AND_NAME ||=
18
- OpenStruct.new(
19
- identification: "IDENTIFICATION",
20
- flags: "FLAG1 | FLAG2",
21
- info: "INFO",
22
- name: "NAME")
23
- INSPECTOR_WITH_FLAGS_AND_INFO ||=
24
- OpenStruct.new(
25
- identification: "IDENTIFICATION",
26
- flags: "FLAG1 | FLAG2",
27
- info: "INFO")
28
- INSPECTOR_WITH_FLAGS_AND_NAME ||=
29
- OpenStruct.new(
30
- identification: "IDENTIFICATION",
31
- flags: "FLAG1 | FLAG2",
32
- name: "NAME")
33
- INSPECTOR_WITH_INFO_AND_NAME ||=
34
- OpenStruct.new(
35
- identification: "IDENTIFICATION",
36
- info: "INFO",
37
- name: "NAME")
38
- INSPECTOR_WITH_NAME ||=
39
- OpenStruct.new(
40
- identification: "IDENTIFICATION",
41
- name: "NAME")
42
- INSPECTOR_WITH_FLAGS ||=
43
- OpenStruct.new(
44
- identification: "IDENTIFICATION",
45
- flags: "FLAG1 | FLAG2")
46
- INSPECTOR_WITH_INFO ||=
47
- OpenStruct.new(
48
- identification: "IDENTIFICATION",
49
- info: "INFO")
50
- INSPECTOR_WITH_BASE ||=
51
- OpenStruct.new(
52
- identification: "IDENTIFICATION")
53
-
54
- puts "== Averaged ============================================================="
55
- Benchmark.ips { |x|
56
- formatter_klasses.each do |formatter_klass|
57
- x.report(formatter_klass) {
58
- formatter_klass.new(INSPECTOR_WITH_FLAGS_AND_INFO_AND_NAME).call
59
- formatter_klass.new(INSPECTOR_WITH_FLAGS_AND_INFO).call
60
- formatter_klass.new(INSPECTOR_WITH_FLAGS_AND_NAME).call
61
- formatter_klass.new(INSPECTOR_WITH_INFO_AND_NAME).call
62
- formatter_klass.new(INSPECTOR_WITH_NAME).call
63
- formatter_klass.new(INSPECTOR_WITH_FLAGS).call
64
- formatter_klass.new(INSPECTOR_WITH_INFO).call
65
- formatter_klass.new(INSPECTOR_WITH_BASE).call
66
- }
67
- end
68
-
69
- x.compare!
70
- }
71
- puts "== Done"
72
-
73
- puts "== Individualized ======================================================="
74
- Benchmark.ips { |x|
75
- formatter_klasses.each do |formatter_klass|
76
- x.report("#{formatter_klass} - Flags and Info and Name") {
77
- formatter_klass.new(INSPECTOR_WITH_FLAGS_AND_INFO_AND_NAME).call
78
- }
79
- end
80
- formatter_klasses.each do |formatter_klass|
81
- x.report("#{formatter_klass} - Flags and Info") {
82
- formatter_klass.new(INSPECTOR_WITH_FLAGS_AND_INFO).call
83
- }
84
- end
85
- formatter_klasses.each do |formatter_klass|
86
- x.report("#{formatter_klass} - Flags and Name") {
87
- formatter_klass.new(INSPECTOR_WITH_FLAGS_AND_NAME).call
88
- }
89
- end
90
- formatter_klasses.each do |formatter_klass|
91
- x.report("#{formatter_klass} - Info and Name") {
92
- formatter_klass.new(INSPECTOR_WITH_INFO_AND_NAME).call
93
- }
94
- end
95
- formatter_klasses.each do |formatter_klass|
96
- x.report("#{formatter_klass} - Name") {
97
- formatter_klass.new(INSPECTOR_WITH_NAME).call
98
- }
99
- end
100
- formatter_klasses.each do |formatter_klass|
101
- x.report("#{formatter_klass} - Flags") {
102
- formatter_klass.new(INSPECTOR_WITH_FLAGS).call
103
- }
104
- end
105
- formatter_klasses.each do |formatter_klass|
106
- x.report("#{formatter_klass} - Info") {
107
- formatter_klass.new(INSPECTOR_WITH_INFO).call
108
- }
109
- end
110
- formatter_klasses.each do |formatter_klass|
111
- x.report("#{formatter_klass} - Base") {
112
- formatter_klass.new(INSPECTOR_WITH_BASE).call
113
- }
114
- end
115
-
116
- x.compare!
117
- }
118
- puts "== Done"
@@ -1,74 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Play from the console with:
4
- # play scripts/benchmarking/object_inspector.rb
5
-
6
- require "ostruct"
7
- require "benchmark/ips"
8
-
9
- inspector_klass = ObjectInspector::Inspector
10
-
11
- OBJECT_WITH_FLAGS_AND_INFO_AND_NAME ||=
12
- OpenStruct.new(
13
- identification: "IDENTIFICATION",
14
- flags: "FLAG1 | FLAG2",
15
- info: "INFO",
16
- name: "NAME")
17
- OBJECT_WITH_FLAGS_AND_INFO ||=
18
- OpenStruct.new(
19
- identification: "IDENTIFICATION",
20
- flags: "FLAG1 | FLAG2",
21
- info: "INFO")
22
- OBJECT_WITH_FLAGS_AND_NAME ||=
23
- OpenStruct.new(
24
- identification: "IDENTIFICATION",
25
- flags: "FLAG1 | FLAG2",
26
- name: "NAME")
27
- OBJECT_WITH_INFO_AND_NAME ||=
28
- OpenStruct.new(
29
- identification: "IDENTIFICATION",
30
- info: "INFO",
31
- name: "NAME")
32
- OBJECT_WITH_NAME ||=
33
- OpenStruct.new(
34
- identification: "IDENTIFICATION",
35
- name: "NAME")
36
- OBJECT_WITH_FLAGS ||=
37
- OpenStruct.new(
38
- identification: "IDENTIFICATION",
39
- flags: "FLAG1 | FLAG2")
40
- OBJECT_WITH_INFO ||=
41
- OpenStruct.new(
42
- identification: "IDENTIFICATION",
43
- info: "INFO")
44
- OBJECT_WITH_BASE ||=
45
- OpenStruct.new(
46
- identification: "IDENTIFICATION")
47
-
48
- puts "== Averaged ============================================================="
49
- Benchmark.ips { |x|
50
- x.report(inspector_klass) {
51
- inspector_klass.inspect(OBJECT_WITH_FLAGS_AND_INFO_AND_NAME)
52
- inspector_klass.inspect(OBJECT_WITH_FLAGS_AND_INFO)
53
- inspector_klass.inspect(OBJECT_WITH_FLAGS_AND_NAME)
54
- inspector_klass.inspect(OBJECT_WITH_INFO_AND_NAME)
55
- inspector_klass.inspect(OBJECT_WITH_NAME)
56
- inspector_klass.inspect(OBJECT_WITH_FLAGS)
57
- inspector_klass.inspect(OBJECT_WITH_INFO)
58
- inspector_klass.inspect(OBJECT_WITH_BASE)
59
- }
60
-
61
- x.report("Ruby") {
62
- OBJECT_WITH_FLAGS_AND_INFO_AND_NAME.inspect
63
- OBJECT_WITH_FLAGS_AND_INFO.inspect
64
- OBJECT_WITH_FLAGS_AND_NAME.inspect
65
- OBJECT_WITH_INFO_AND_NAME.inspect
66
- OBJECT_WITH_NAME.inspect
67
- OBJECT_WITH_FLAGS.inspect
68
- OBJECT_WITH_INFO.inspect
69
- OBJECT_WITH_BASE.inspect
70
- }
71
-
72
- x.compare!
73
- }
74
- puts "== Done"