object_inspector 0.7.1 → 0.8.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66a1b54f20e570dfe382fe163d12f8df723c50c09349e61d9e18540553829d78
4
- data.tar.gz: 8ecefc9bc3dd82c15370153982f6725053588a1e40a740c028c5014c9ecebda0
3
+ metadata.gz: 46375ea86105e9cb191d0ba2c90d56a950cf6179089c735d6191371e035d1c1d
4
+ data.tar.gz: bd1965e84b3ceab6673df8e300604a37910be007031fbfc14f305b3105b0d7c4
5
5
  SHA512:
6
- metadata.gz: 1f54049cb8ddfa9b9dc6ec98e7372fd569eefe8f5a98c0408376f3395961129fc86f888cf03f5b31f9be94ea1f783c50c72888b18ae5fefb4f86f1e61310adea
7
- data.tar.gz: 39c9e9e2dba1e99dbf790915c4593b1ec4f2e6dd013fa80e6ba9baca13b6b630c9543dd41f42796c5e4e5631063c81f173f43a62708e7706b6e03a6865b1f284
6
+ metadata.gz: 21225b2857499c836b7055293ed60182b20504ddc308415179364aebc9024c12b03b083cf8601717b27fb318b3e1b4f06788decc2a6666a8c85b67c95802db0e
7
+ data.tar.gz: 7f75c140f1b66be107f667eb94e16fb59a9c40c884e4ac7fab0cffb124cb0492302a2f004ed5d82e03edd33a5ff714e8adbb97560f87a37a11576cffb064014e
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024 Paul DobbinSchmaltz
3
+ Copyright (c) 2025 Paul DobbinSchmaltz
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![Gem Version](https://img.shields.io/github/v/release/pdobb/object_inspector)](https://img.shields.io/github/v/release/pdobb/object_inspector)
4
4
  [![CI Actions](https://github.com/pdobb/object_inspector/actions/workflows/ci.yml/badge.svg)](https://github.com/pdobb/object_inspector/actions)
5
- [![Maintainability](https://api.codeclimate.com/v1/badges/34e821263d9e0c33d536/maintainability)](https://codeclimate.com/github/pdobb/object_inspector/maintainability)
6
5
 
7
6
  Object Inspector 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 represent objects. Great for the console, logging, etc.
8
7
 
@@ -30,9 +29,21 @@ Or install it yourself:
30
29
 
31
30
  Tested MRI Ruby Versions:
32
31
 
33
- - 3.1
34
32
  - 3.2
35
33
  - 3.3
34
+ - 3.4
35
+
36
+ For Ruby 2.7 support, install object_inspector gem version 0.6.3.
37
+
38
+ ```ruby
39
+ gem "object_inspector", "0.6.3"
40
+ ```
41
+
42
+ For Ruby 3.1 support, install object_inspector gem version 0.7.0.
43
+
44
+ ```ruby
45
+ gem "object_inspector", "0.6.3"
46
+ ```
36
47
 
37
48
  Object Inspector has no other dependencies.
38
49
 
@@ -45,7 +56,6 @@ _Note: In a Rails app, the following would go in e.g. `config/initializers/objec
45
56
  ```ruby
46
57
  # Default values are shown.
47
58
  ObjectInspector.configure do |config|
48
- config.enabled = true
49
59
  config.formatter_class = ObjectInspector::TemplatingFormatter
50
60
  config.inspect_method_prefix = "inspect"
51
61
  config.default_scope = ObjectInspector::Scope.new(:self)
@@ -228,9 +238,14 @@ scope.complex? { "MATCH" } # => "*"
228
238
  ### Scope Joiners
229
239
 
230
240
  ObjectInspector::Scope also offers helper methods for uniformly joining inspect elements:
231
- - `join_name` -- Joins name parts with ` - ` by default
232
- - `join_flags` -- Joins flags with ` / ` by default
233
- - `join_info` -- Joins info items with ` | ` by default
241
+
242
+ ```ruby
243
+ join_name # Joins name parts with ` - ` by default
244
+ join_flags # Joins flags with ` / ` by default
245
+ join_info # Joins info items with ` | ` by default
246
+ ```
247
+
248
+ For example:
234
249
 
235
250
  ```ruby
236
251
  scope = ObjectInspector::Scope.new(:verbose)
@@ -584,7 +599,7 @@ To install this gem onto your local machine, run `bundle exec rake install`.
584
599
 
585
600
  ### Testing
586
601
 
587
- To test this gem (gemwork):
602
+ To test this gem:
588
603
 
589
604
  ```bash
590
605
  rake
@@ -603,7 +618,7 @@ npx prettier . --write
603
618
 
604
619
  ### Releases
605
620
 
606
- To release a new version of object_inspector to RubyGems:
621
+ To release a new version of this gem to RubyGems:
607
622
 
608
623
  1. Update the version number in `version.rb`
609
624
  2. Update `CHANGELOG.md`
@@ -8,19 +8,7 @@ module ObjectInspector::InspectorsHelper
8
8
  # passing it the passed in `kwargs` (keyword arguments).
9
9
  #
10
10
  # @return [String]
11
- def inspect(**kwargs)
12
- return super() if ObjectInspector.configuration.disabled?
13
-
14
- ObjectInspector::Inspector.inspect(self, **kwargs)
15
- end
16
-
17
- private
18
-
19
- # :reek:UtilityFunction
20
-
21
- # Allow ActiveRecord::Core#pretty_print to produce the standard Pretty-printed
22
- # output (vs just straight #inspect String) when ObjectInspector is disabled.
23
- def custom_inspect_method_defined?
24
- ObjectInspector.configuration.enabled?
11
+ def inspect(object = self, ...)
12
+ ObjectInspector::Inspector.inspect(object, ...)
25
13
  end
26
14
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module ObjectInspector
4
4
  # The current ObjectInspector gem version.
5
- VERSION = "0.7.1"
5
+ VERSION = "0.8.0"
6
6
  end
@@ -36,8 +36,7 @@ module ObjectInspector
36
36
  :issues_separator,
37
37
  :info_separator
38
38
 
39
- def initialize # rubocop:disable Metrics/MethodLength
40
- @enabled = true
39
+ def initialize
41
40
  @formatter_class = TemplatingFormatter
42
41
  @inspect_method_prefix = "inspect"
43
42
  @default_scope = Scope.new(:self)
@@ -50,21 +49,6 @@ module ObjectInspector
50
49
  @info_separator = " | "
51
50
  end
52
51
 
53
- def toggle = enabled? ? disable : enable
54
- def enabled? = @enabled
55
-
56
- def enable
57
- @enabled = true
58
- puts(" -> ObjectInspector enabled")
59
- end
60
-
61
- def disabled? = !enabled?
62
-
63
- def disable
64
- @enabled = false
65
- puts(" -> ObjectInspector disabled")
66
- end
67
-
68
52
  def formatter_class=(value)
69
53
  unless value.is_a?(Class)
70
54
  raise TypeError, "Formatter must be a Class constant"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: object_inspector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul DobbinSchmaltz
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
10
+ date: 2025-01-04 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: benchmark-ips
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubygems_version: 3.7.2
113
+ rubygems_version: 3.6.2
114
114
  specification_version: 4
115
115
  summary: Object Inspector builds uniformly formatted inspect output with customizable
116
116
  amounts of detail.