amazing_print 1.3.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +0 -6
- data/CHANGELOG.md +24 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +51 -47
- data/README.md +9 -7
- data/lib/amazing_print/colorize.rb +5 -14
- data/lib/amazing_print/colors.rb +37 -0
- data/lib/amazing_print/core_ext/awesome_method_array.rb +4 -4
- data/lib/amazing_print/core_ext/class.rb +1 -1
- data/lib/amazing_print/core_ext/logger.rb +1 -3
- data/lib/amazing_print/core_ext/object.rb +1 -1
- data/lib/amazing_print/custom_defaults.rb +10 -3
- data/lib/amazing_print/ext/active_record.rb +5 -9
- data/lib/amazing_print/ext/active_support.rb +1 -3
- data/lib/amazing_print/ext/mongo_mapper.rb +4 -7
- data/lib/amazing_print/ext/mongoid.rb +2 -6
- data/lib/amazing_print/ext/nobrainer.rb +3 -5
- data/lib/amazing_print/ext/nokogiri.rb +1 -3
- data/lib/amazing_print/ext/ostruct.rb +1 -3
- data/lib/amazing_print/ext/ripple.rb +4 -5
- data/lib/amazing_print/formatter.rb +5 -6
- data/lib/amazing_print/formatters/array_formatter.rb +7 -6
- data/lib/amazing_print/formatters/base_formatter.rb +20 -25
- data/lib/amazing_print/formatters/class_formatter.rb +1 -0
- data/lib/amazing_print/formatters/dir_formatter.rb +11 -1
- data/lib/amazing_print/formatters/file_formatter.rb +11 -1
- data/lib/amazing_print/formatters/hash_formatter.rb +5 -3
- data/lib/amazing_print/formatters/method_formatter.rb +1 -0
- data/lib/amazing_print/formatters/mswin_helper.rb +63 -0
- data/lib/amazing_print/formatters/object_formatter.rb +2 -1
- data/lib/amazing_print/formatters/simple_formatter.rb +1 -0
- data/lib/amazing_print/formatters/struct_formatter.rb +2 -1
- data/lib/amazing_print/inspector.rb +29 -5
- data/lib/amazing_print/version.rb +1 -1
- data/lib/amazing_print.rb +3 -7
- data/spec/active_record_helper.rb +3 -0
- data/spec/colors_spec.rb +15 -6
- data/spec/core_ext/logger_spec.rb +7 -7
- data/spec/ext/action_controller_spec.rb +5 -5
- data/spec/ext/active_model_spec.rb +1 -1
- data/spec/ext/active_record_spec.rb +39 -73
- data/spec/ext/active_support_spec.rb +3 -3
- data/spec/ext/mongo_mapper_spec.rb +15 -11
- data/spec/ext/mongoid_spec.rb +7 -3
- data/spec/ext/nobrainer_spec.rb +6 -2
- data/spec/ext/nokogiri_spec.rb +7 -7
- data/spec/ext/ripple_spec.rb +6 -2
- data/spec/ext/sequel_spec.rb +1 -1
- data/spec/formats_spec.rb +101 -90
- data/spec/methods_spec.rb +12 -4
- data/spec/misc_spec.rb +29 -70
- data/spec/objects_spec.rb +4 -0
- data/spec/spec_helper.rb +11 -9
- metadata +10 -142
- data/lib/amazing_print/core_ext/string.rb +0 -45
- data/spec/core_ext/string_spec.rb +0 -15
metadata
CHANGED
@@ -1,100 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amazing_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Dvorkin
|
8
8
|
- Kevin McCormackPatrik Wenger
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: appraisal
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '2.3'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - "~>"
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '2.3'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: fakefs
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - "~>"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '1.2'
|
35
|
-
type: :development
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '1.2'
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: nokogiri
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - "~>"
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '1.10'
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - "~>"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '1.10'
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: pry
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
59
|
-
requirements:
|
60
|
-
- - ">="
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: rspec
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - "~>"
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '3.9'
|
77
|
-
type: :development
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - "~>"
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '3.9'
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: rubocop
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
87
|
-
requirements:
|
88
|
-
- - "~>"
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version: 0.81.0
|
91
|
-
type: :development
|
92
|
-
prerelease: false
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
94
|
-
requirements:
|
95
|
-
- - "~>"
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: 0.81.0
|
12
|
+
date: 2023-05-24 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
98
14
|
description: 'Great Ruby debugging companion: pretty print Ruby objects to visualize
|
99
15
|
their structure. Supports custom object formatting via plugins'
|
100
16
|
email: harlemsquirrel@gmail.com
|
@@ -113,12 +29,12 @@ files:
|
|
113
29
|
- Rakefile
|
114
30
|
- lib/amazing_print.rb
|
115
31
|
- lib/amazing_print/colorize.rb
|
32
|
+
- lib/amazing_print/colors.rb
|
116
33
|
- lib/amazing_print/core_ext/awesome_method_array.rb
|
117
34
|
- lib/amazing_print/core_ext/class.rb
|
118
35
|
- lib/amazing_print/core_ext/kernel.rb
|
119
36
|
- lib/amazing_print/core_ext/logger.rb
|
120
37
|
- lib/amazing_print/core_ext/object.rb
|
121
|
-
- lib/amazing_print/core_ext/string.rb
|
122
38
|
- lib/amazing_print/custom_defaults.rb
|
123
39
|
- lib/amazing_print/ext/action_view.rb
|
124
40
|
- lib/amazing_print/ext/active_record.rb
|
@@ -139,6 +55,7 @@ files:
|
|
139
55
|
- lib/amazing_print/formatters/file_formatter.rb
|
140
56
|
- lib/amazing_print/formatters/hash_formatter.rb
|
141
57
|
- lib/amazing_print/formatters/method_formatter.rb
|
58
|
+
- lib/amazing_print/formatters/mswin_helper.rb
|
142
59
|
- lib/amazing_print/formatters/object_formatter.rb
|
143
60
|
- lib/amazing_print/formatters/simple_formatter.rb
|
144
61
|
- lib/amazing_print/formatters/struct_formatter.rb
|
@@ -149,7 +66,6 @@ files:
|
|
149
66
|
- spec/active_record_helper.rb
|
150
67
|
- spec/colors_spec.rb
|
151
68
|
- spec/core_ext/logger_spec.rb
|
152
|
-
- spec/core_ext/string_spec.rb
|
153
69
|
- spec/ext/action_controller_spec.rb
|
154
70
|
- spec/ext/action_view_spec.rb
|
155
71
|
- spec/ext/active_model_spec.rb
|
@@ -198,7 +114,7 @@ homepage: https://github.com/amazing-print/amazing_print
|
|
198
114
|
licenses:
|
199
115
|
- MIT
|
200
116
|
metadata: {}
|
201
|
-
post_install_message:
|
117
|
+
post_install_message:
|
202
118
|
rdoc_options: []
|
203
119
|
require_paths:
|
204
120
|
- lib
|
@@ -213,56 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
129
|
- !ruby/object:Gem::Version
|
214
130
|
version: '0'
|
215
131
|
requirements: []
|
216
|
-
rubygems_version: 3.
|
217
|
-
signing_key:
|
132
|
+
rubygems_version: 3.4.10
|
133
|
+
signing_key:
|
218
134
|
specification_version: 4
|
219
135
|
summary: Pretty print Ruby objects with proper indentation and colors
|
220
|
-
test_files:
|
221
|
-
- spec/active_record_helper.rb
|
222
|
-
- spec/colors_spec.rb
|
223
|
-
- spec/core_ext/logger_spec.rb
|
224
|
-
- spec/core_ext/string_spec.rb
|
225
|
-
- spec/ext/action_controller_spec.rb
|
226
|
-
- spec/ext/action_view_spec.rb
|
227
|
-
- spec/ext/active_model_spec.rb
|
228
|
-
- spec/ext/active_record_spec.rb
|
229
|
-
- spec/ext/active_support_spec.rb
|
230
|
-
- spec/ext/mongo_mapper_spec.rb
|
231
|
-
- spec/ext/mongoid_spec.rb
|
232
|
-
- spec/ext/nobrainer_spec.rb
|
233
|
-
- spec/ext/nokogiri_spec.rb
|
234
|
-
- spec/ext/ostruct_spec.rb
|
235
|
-
- spec/ext/ripple_spec.rb
|
236
|
-
- spec/ext/sequel_spec.rb
|
237
|
-
- spec/formats_spec.rb
|
238
|
-
- spec/methods_spec.rb
|
239
|
-
- spec/misc_spec.rb
|
240
|
-
- spec/objects_spec.rb
|
241
|
-
- spec/sequel_helper.rb
|
242
|
-
- spec/spec_helper.rb
|
243
|
-
- spec/support/active_record_data/3_2_diana.txt
|
244
|
-
- spec/support/active_record_data/3_2_diana_legacy.txt
|
245
|
-
- spec/support/active_record_data/3_2_multi.txt
|
246
|
-
- spec/support/active_record_data/3_2_multi_legacy.txt
|
247
|
-
- spec/support/active_record_data/4_0_diana.txt
|
248
|
-
- spec/support/active_record_data/4_0_multi.txt
|
249
|
-
- spec/support/active_record_data/4_1_diana.txt
|
250
|
-
- spec/support/active_record_data/4_1_multi.txt
|
251
|
-
- spec/support/active_record_data/4_2_diana.txt
|
252
|
-
- spec/support/active_record_data/4_2_diana_legacy.txt
|
253
|
-
- spec/support/active_record_data/4_2_multi.txt
|
254
|
-
- spec/support/active_record_data/4_2_multi_legacy.txt
|
255
|
-
- spec/support/active_record_data/5_0_diana.txt
|
256
|
-
- spec/support/active_record_data/5_0_multi.txt
|
257
|
-
- spec/support/active_record_data/5_1_diana.txt
|
258
|
-
- spec/support/active_record_data/5_1_multi.txt
|
259
|
-
- spec/support/active_record_data/5_2_diana.txt
|
260
|
-
- spec/support/active_record_data/5_2_multi.txt
|
261
|
-
- spec/support/active_record_data/6_0_diana.txt
|
262
|
-
- spec/support/active_record_data/6_0_multi.txt
|
263
|
-
- spec/support/active_record_data/6_1_diana.txt
|
264
|
-
- spec/support/active_record_data/6_1_multi.txt
|
265
|
-
- spec/support/active_record_data.rb
|
266
|
-
- spec/support/ext_verifier.rb
|
267
|
-
- spec/support/mongoid_versions.rb
|
268
|
-
- spec/support/rails_versions.rb
|
136
|
+
test_files: []
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# Copyright (c) 2010-2016 Michael Dvorkin and contributors
|
3
|
-
#
|
4
|
-
# AmazingPrint is freely distributable under the terms of MIT license.
|
5
|
-
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
6
|
-
#------------------------------------------------------------------------------
|
7
|
-
|
8
|
-
# frozen_string_literal: true
|
9
|
-
|
10
|
-
class String
|
11
|
-
#
|
12
|
-
# ANSI color codes:
|
13
|
-
# \e => escape
|
14
|
-
# 30 => color base
|
15
|
-
# 1 => bright
|
16
|
-
# 0 => normal
|
17
|
-
#
|
18
|
-
# For HTML coloring we use <kbd> tag instead of <span> to require monospace
|
19
|
-
# font. Note that beloved <tt> has been removed from HTML5.
|
20
|
-
#
|
21
|
-
%w[gray red green yellow blue purple cyan white].zip(
|
22
|
-
%w[black darkred darkgreen brown navy darkmagenta darkcyan slategray]
|
23
|
-
).each_with_index do |(color, shade), i|
|
24
|
-
# NOTE: Format strings are created once only, for performance, and remembered by closures.
|
25
|
-
|
26
|
-
term_bright_seq = "\e[1;#{30 + i}m%s\e[0m"
|
27
|
-
html_bright_seq = %(<kbd style="color:#{color}">%s</kbd>)
|
28
|
-
|
29
|
-
define_method color do |html = false, *|
|
30
|
-
(html ? html_bright_seq : term_bright_seq) % self
|
31
|
-
end
|
32
|
-
|
33
|
-
term_normal_seq = "\e[0;#{30 + i}m%s\e[0m"
|
34
|
-
html_normal_seq = %(<kbd style="color:#{shade}">%s</kbd>)
|
35
|
-
|
36
|
-
define_method "#{color}ish" do |html = false, *|
|
37
|
-
(html ? html_normal_seq : term_normal_seq) % self
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# Remove ANSI color codes.
|
42
|
-
def uncolor
|
43
|
-
gsub(/\e\[[0-9;]*m/, '')
|
44
|
-
end
|
45
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
RSpec.describe 'String extensions' do
|
6
|
-
%i[gray red green yellow blue purple cyan white].each_with_index do |color, i|
|
7
|
-
it "should have #{color} color" do
|
8
|
-
expect(color.to_s.send(color)).to eq("\e[1;#{30 + i}m#{color}\e[0m")
|
9
|
-
end
|
10
|
-
|
11
|
-
it "should have #{color}ish color" do
|
12
|
-
expect(color.to_s.send(:"#{color}ish")).to eq("\e[0;#{30 + i}m#{color}\e[0m")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|