amazing_print 1.7.2 → 1.8.1
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 +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +9 -9
- data/lib/amazing_print/core_ext/awesome_method_array.rb +2 -2
- data/lib/amazing_print/ext/mongo_mapper.rb +2 -2
- data/lib/amazing_print/formatter.rb +1 -1
- data/lib/amazing_print/formatters/array_formatter.rb +1 -1
- data/lib/amazing_print/formatters/base_formatter.rb +2 -2
- data/lib/amazing_print/formatters/hash_formatter.rb +2 -2
- data/lib/amazing_print/formatters/object_formatter.rb +1 -1
- data/lib/amazing_print/formatters/struct_formatter.rb +1 -1
- data/lib/amazing_print/inspector.rb +2 -2
- data/lib/amazing_print/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c54bf5089bc3eb9ecb72f953d2b7972ec91f512d17d85f64e0e68bfffe963eb
|
4
|
+
data.tar.gz: e25109a0515688c4a3212e2dfa1a9a65a615959f67372a88f77011d8e0a531e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53eb2f3a3bba9510f098ea1d550a2c4ce2080f21c4b19daea1e40e7b4fdc8df4336ef494bdb2626892e73f17ab6dc4bc2001dea1f64168d8d331baeb998ee273
|
7
|
+
data.tar.gz: 5cf3937b23f27e89a75c2a0adbf0353f8a2fb5f936f836b44f7e152559bdb0c7f8b1e30c95f9bca506342bf08b2da3e29b377bf1757ccf031de7e24cf7ccdc99
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
## v1.8.1
|
6
|
+
|
7
|
+
- Fix authors list in gemspec #128
|
8
|
+
- Use array.length.zero? to avoid issues with ActiveRecord collection proxy #129
|
9
|
+
- grammar glowup in README.md #130
|
10
|
+
|
11
|
+
## v1.8.0
|
12
|
+
|
13
|
+
- Drop Ruby 3.0 and add Ruby 3.4 #125
|
14
|
+
|
3
15
|
## v1.7.2
|
4
16
|
|
5
17
|
- update the version string in `AmazingPrint.version`
|
data/README.md
CHANGED
@@ -8,14 +8,14 @@
|
|
8
8
|
|
|
9
9
|
[](https://gitter.im/amazing-print/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
10
10
|
|
11
|
-
AmazingPrint is a fork of [AwesomePrint](https://github.com/awesome-print/awesome_print) which became stale and should be used in its place to avoid conflicts. It is a Ruby library that pretty prints Ruby objects in full color exposing their internal structure with proper indentation. Rails ActiveRecord objects and usage within Rails templates are supported via included mixins.
|
11
|
+
AmazingPrint is a fork of [AwesomePrint](https://github.com/awesome-print/awesome_print), which became stale, and should be used in its place to avoid conflicts. It is a Ruby library that pretty prints Ruby objects in full color, exposing their internal structure with proper indentation. Rails ActiveRecord objects and usage within Rails templates are supported via included mixins.
|
12
12
|
|
13
13
|

|
14
14
|
|
15
15
|
### Supported Versions ###
|
16
16
|
|
17
|
-
- Ruby >=
|
18
|
-
- Rails >=
|
17
|
+
- Ruby >= 3.1
|
18
|
+
- Rails >= 6.1
|
19
19
|
|
20
20
|
### Installation ###
|
21
21
|
# Installing as Ruby gem
|
@@ -266,7 +266,7 @@ rails>
|
|
266
266
|
```
|
267
267
|
|
268
268
|
### IRB integration ###
|
269
|
-
To use amazing_print as default formatter in irb and Rails console add the following
|
269
|
+
To use amazing_print as the default formatter in irb and the Rails console, add the following
|
270
270
|
code to your ~/.irbrc file:
|
271
271
|
|
272
272
|
```ruby
|
@@ -293,7 +293,7 @@ By default, this logs at the :debug level. You can override that globally with:
|
|
293
293
|
|
294
294
|
:log_level => :info
|
295
295
|
|
296
|
-
in the custom defaults (see below). You can also override on a per call basis with:
|
296
|
+
in the custom defaults (see below). You can also override it on a per call basis with:
|
297
297
|
|
298
298
|
logger.ap object, :warn
|
299
299
|
# or
|
@@ -310,7 +310,7 @@ within Rails templates. For example:
|
|
310
310
|
<%= ap @accounts.first %> # ERB
|
311
311
|
!= ap @accounts.first # HAML
|
312
312
|
|
313
|
-
With other web frameworks (
|
313
|
+
With other web frameworks (for example in Sinatra templates) you can explicitly request HTML
|
314
314
|
formatting:
|
315
315
|
|
316
316
|
<%= ap @accounts.first, :html => true %>
|
@@ -324,8 +324,8 @@ red text # (it's red)
|
|
324
324
|
```
|
325
325
|
|
326
326
|
### Setting Custom Defaults ###
|
327
|
-
You can set your own default options by creating ``aprc`` file in your `$XDG_CONFIG_HOME`
|
328
|
-
directory (defaults to `~/.config` if undefined). Within that file assign your defaults
|
327
|
+
You can set your own default options by creating an ``aprc`` file in your `$XDG_CONFIG_HOME`
|
328
|
+
directory (which defaults to `~/.config` if undefined). Within that file assign your defaults
|
329
329
|
to ``AmazingPrint.defaults``.
|
330
330
|
For example:
|
331
331
|
|
@@ -340,7 +340,7 @@ AmazingPrint.defaults = {
|
|
340
340
|
}
|
341
341
|
```
|
342
342
|
|
343
|
-
The previous `~/.aprc` location is still supported as fallback.
|
343
|
+
The previous `~/.aprc` location is still supported as a fallback.
|
344
344
|
|
345
345
|
## Versioning
|
346
346
|
|
@@ -56,7 +56,7 @@ module AwesomeMethodArray # :nodoc:
|
|
56
56
|
# the comment :-)
|
57
57
|
#
|
58
58
|
arr = if blk
|
59
|
-
super
|
59
|
+
super do |match|
|
60
60
|
#
|
61
61
|
# The binding can only be used with Ruby-defined methods, therefore
|
62
62
|
# we must rescue potential "ArgumentError: Can't create Binding from
|
@@ -75,7 +75,7 @@ module AwesomeMethodArray # :nodoc:
|
|
75
75
|
yield match
|
76
76
|
end
|
77
77
|
else
|
78
|
-
super
|
78
|
+
super
|
79
79
|
end
|
80
80
|
arr.instance_variable_set(:@__awesome_methods__, instance_variable_get(:@__awesome_methods__))
|
81
81
|
arr.select! { |item| item.is_a?(Symbol) || item.is_a?(String) } # grep block might return crap.
|
@@ -19,8 +19,8 @@ module AmazingPrint
|
|
19
19
|
cast = cast_without_mongo_mapper(object, type)
|
20
20
|
|
21
21
|
if defined?(::MongoMapper::Document)
|
22
|
-
if object.is_a?(Class) && !
|
23
|
-
|
22
|
+
if object.is_a?(Class) && !object.ancestors.intersect?([::MongoMapper::Document,
|
23
|
+
::MongoMapper::EmbeddedDocument]).nil?
|
24
24
|
cast = :mongo_mapper_class
|
25
25
|
elsif object.is_a?(::MongoMapper::Document) || object.is_a?(::MongoMapper::EmbeddedDocument)
|
26
26
|
cast = :mongo_mapper_instance
|
@@ -48,7 +48,7 @@ module AmazingPrint
|
|
48
48
|
elsif (hash = convert_to_hash(object))
|
49
49
|
awesome_hash(hash)
|
50
50
|
else
|
51
|
-
awesome_simple(object.inspect.to_s, type, @inspector)
|
51
|
+
awesome_simple(object.inspect.to_s, type, @inspector) # rubocop:disable Lint/RedundantTypeConversion
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -107,10 +107,10 @@ module AmazingPrint
|
|
107
107
|
"#{align(awesome_key, width)}#{colorize(' => ', :hash)}#{inspector.awesome(value)}"
|
108
108
|
end
|
109
109
|
|
110
|
-
def plain_single_line(&
|
110
|
+
def plain_single_line(&)
|
111
111
|
plain = options[:plain]
|
112
112
|
options[:plain] = true
|
113
|
-
single_line(&
|
113
|
+
single_line(&)
|
114
114
|
ensure
|
115
115
|
options[:plain] = plain
|
116
116
|
end
|
@@ -68,7 +68,7 @@ module AmazingPrint
|
|
68
68
|
# We need to ensure that the original Kernel#format is used here instead of the one
|
69
69
|
# defined above.
|
70
70
|
# rubocop:disable Style/ColonMethodCall
|
71
|
-
str + Kernel::format(':0x%08x',
|
71
|
+
str + Kernel::format(':0x%08x', object.__id__ * 2)
|
72
72
|
# rubocop:enable Style/ColonMethodCall
|
73
73
|
end
|
74
74
|
|
@@ -61,7 +61,7 @@ module AmazingPrint
|
|
61
61
|
# We need to ensure that the original Kernel#format is used here instead of the one defined
|
62
62
|
# above.
|
63
63
|
# rubocop:disable Style/ColonMethodCall
|
64
|
-
Kernel::format("#{struct.class.superclass}:#{struct.class}:0x%08x",
|
64
|
+
Kernel::format("#{struct.class.superclass}:#{struct.class}:0x%08x", struct.__id__ * 2)
|
65
65
|
# rubocop:enable Style/ColonMethodCall
|
66
66
|
end
|
67
67
|
|
@@ -79,8 +79,8 @@ module AmazingPrint
|
|
79
79
|
indentator.indentation
|
80
80
|
end
|
81
81
|
|
82
|
-
def increase_indentation(&
|
83
|
-
indentator.indent(&
|
82
|
+
def increase_indentation(&)
|
83
|
+
indentator.indent(&)
|
84
84
|
end
|
85
85
|
|
86
86
|
# Dispatcher that detects data nesting and invokes object-aware formatter.
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazing_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Dvorkin
|
8
|
-
- Kevin
|
8
|
+
- Kevin McCormack
|
9
|
+
- Patrik Wenger
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
13
|
dependencies: []
|
13
14
|
description: 'Great Ruby debugging companion: pretty print Ruby objects to visualize
|
14
15
|
their structure. Supports custom object formatting via plugins'
|
@@ -69,14 +70,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
70
|
requirements:
|
70
71
|
- - ">="
|
71
72
|
- !ruby/object:Gem::Version
|
72
|
-
version: 3.
|
73
|
+
version: 3.1.0
|
73
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
75
|
requirements:
|
75
76
|
- - ">="
|
76
77
|
- !ruby/object:Gem::Version
|
77
78
|
version: '0'
|
78
79
|
requirements: []
|
79
|
-
rubygems_version: 3.6.
|
80
|
+
rubygems_version: 3.6.7
|
80
81
|
specification_version: 4
|
81
82
|
summary: Pretty print Ruby objects with proper indentation and colors
|
82
83
|
test_files: []
|