awesome_print 1.8.0 → 2.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Appraisals +16 -48
- data/CHANGELOG.md +10 -1
- data/LICENSE +16 -19
- data/README.md +3 -10
- data/lib/ap.rb +1 -5
- data/lib/awesome_print.rb +7 -29
- data/lib/awesome_print/colorize.rb +2 -0
- data/lib/awesome_print/core_ext/active_support.rb +7 -0
- data/lib/awesome_print/core_ext/awesome_method_array.rb +0 -6
- data/lib/awesome_print/core_ext/class.rb +0 -5
- data/lib/awesome_print/core_ext/kernel.rb +0 -5
- data/lib/awesome_print/core_ext/logger.rb +0 -5
- data/lib/awesome_print/core_ext/object.rb +0 -5
- data/lib/awesome_print/core_ext/string.rb +0 -5
- data/lib/awesome_print/formatter.rb +38 -98
- data/lib/awesome_print/formatters/array_formatter.rb +10 -7
- data/lib/awesome_print/formatters/base_formatter.rb +17 -50
- data/lib/awesome_print/formatters/bigdecimal_formatter.rb +20 -0
- data/lib/awesome_print/formatters/class_formatter.rb +5 -6
- data/lib/awesome_print/formatters/dir_formatter.rb +4 -6
- data/lib/awesome_print/formatters/ext/active_model_error_formatter.rb +44 -0
- data/lib/awesome_print/formatters/ext/active_record_attributeset_formatter.rb +27 -0
- data/lib/awesome_print/formatters/ext/active_record_class_formatter.rb +43 -0
- data/lib/awesome_print/formatters/ext/active_record_instance_formatter.rb +48 -0
- data/lib/awesome_print/formatters/ext/active_record_relation_formatter.rb +19 -0
- data/lib/awesome_print/formatters/ext/bson_objectid_formatter.rb +20 -0
- data/lib/awesome_print/formatters/ext/hash_with_indifferent_access_formatter.rb +20 -0
- data/lib/awesome_print/formatters/ext/mongoid_document_formatter.rb +59 -0
- data/lib/awesome_print/formatters/ext/nokogiri_document_formatter.rb +30 -0
- data/lib/awesome_print/formatters/ext/nokogiri_node_formatter.rb +29 -0
- data/lib/awesome_print/formatters/ext/nokogiri_nodeset_formatter.rb +32 -0
- data/lib/awesome_print/formatters/ext/sequel_dataset_formatter.rb +20 -0
- data/lib/awesome_print/formatters/ext/sequel_model_class_formatter.rb +25 -0
- data/lib/awesome_print/formatters/ext/sequel_model_formatter.rb +26 -0
- data/lib/awesome_print/formatters/ext/time_with_zone_formatter.rb +24 -0
- data/lib/awesome_print/formatters/fallback_formatter.rb +55 -0
- data/lib/awesome_print/formatters/false_class_formatter.rb +15 -0
- data/lib/awesome_print/formatters/file_formatter.rb +4 -6
- data/lib/awesome_print/formatters/hash_formatter.rb +12 -7
- data/lib/awesome_print/formatters/integer_formatter.rb +11 -0
- data/lib/awesome_print/formatters/method_formatter.rb +8 -6
- data/lib/awesome_print/formatters/module_formatter.rb +18 -0
- data/lib/awesome_print/formatters/nil_class_formatter.rb +19 -0
- data/lib/awesome_print/formatters/object_formatter.rb +20 -7
- data/lib/awesome_print/formatters/open_struct.rb +19 -0
- data/lib/awesome_print/formatters/range_formatter.rb +11 -0
- data/lib/awesome_print/formatters/rational_formatter.rb +15 -0
- data/lib/awesome_print/formatters/set_formatter.rb +19 -0
- data/lib/awesome_print/formatters/simple_formatter.rb +10 -8
- data/lib/awesome_print/formatters/string_formatter.rb +14 -0
- data/lib/awesome_print/formatters/struct_formatter.rb +8 -6
- data/lib/awesome_print/formatters/symbol_formatter.rb +18 -0
- data/lib/awesome_print/formatters/true_class_formatter.rb +15 -0
- data/lib/awesome_print/formatters/unbound_method_formatter.rb +15 -0
- data/lib/awesome_print/inspector.rb +20 -16
- data/lib/awesome_print/limiter.rb +63 -0
- data/lib/awesome_print/registrar.rb +20 -0
- data/lib/awesome_print/version.rb +6 -6
- data/spec/formatters/array_spec.rb +251 -0
- data/spec/formatters/big_decimal_spec.rb +28 -0
- data/spec/formatters/class_spec.rb +91 -0
- data/spec/formatters/dir_file_spec.rb +43 -0
- data/spec/{ext → formatters/ext}/active_record_spec.rb +27 -63
- data/spec/{ext → formatters/ext}/active_support_spec.rb +6 -6
- data/spec/{ext → formatters/ext}/mongoid_spec.rb +4 -41
- data/spec/{ext → formatters/ext}/nokogiri_spec.rb +0 -0
- data/spec/formatters/hash_spec.rb +284 -0
- data/spec/{methods_spec.rb → formatters/methods_spec.rb} +13 -7
- data/spec/{objects_spec.rb → formatters/objects_spec.rb} +49 -0
- data/spec/{ext → formatters}/ostruct_spec.rb +1 -0
- data/spec/formatters/set_spec.rb +49 -0
- data/spec/formatters/struct_spec.rb +61 -0
- data/spec/merge_options_spec.rb +13 -0
- data/spec/misc_spec.rb +21 -21
- data/spec/spec_helper.rb +5 -10
- data/spec/support/active_record_data/5_1_diana.txt +104 -0
- data/spec/support/active_record_data/5_1_multi.txt +210 -0
- data/spec/support/active_record_data/5_2_diana.txt +104 -0
- data/spec/support/active_record_data/5_2_multi.txt +210 -0
- data/spec/support/ext_verifier.rb +0 -15
- data/spec/support/mongoid_versions.rb +4 -4
- data/spec/support/rails_versions.rb +10 -20
- metadata +98 -87
- data/lib/awesome_print/core_ext/method.rb +0 -21
- data/lib/awesome_print/ext/action_view.rb +0 -22
- data/lib/awesome_print/ext/active_record.rb +0 -78
- data/lib/awesome_print/ext/active_support.rb +0 -47
- data/lib/awesome_print/ext/mongo_mapper.rb +0 -124
- data/lib/awesome_print/ext/mongoid.rb +0 -67
- data/lib/awesome_print/ext/nobrainer.rb +0 -52
- data/lib/awesome_print/ext/nokogiri.rb +0 -45
- data/lib/awesome_print/ext/ostruct.rb +0 -27
- data/lib/awesome_print/ext/ripple.rb +0 -71
- data/lib/awesome_print/ext/sequel.rb +0 -58
- data/spec/ext/action_view_spec.rb +0 -18
- data/spec/ext/mongo_mapper_spec.rb +0 -261
- data/spec/ext/nobrainer_spec.rb +0 -59
- data/spec/ext/ripple_spec.rb +0 -48
- data/spec/formats_spec.rb +0 -779
- data/spec/support/active_record_data/3_2_diana.txt +0 -24
- data/spec/support/active_record_data/3_2_diana_legacy.txt +0 -24
- data/spec/support/active_record_data/3_2_multi.txt +0 -50
- data/spec/support/active_record_data/3_2_multi_legacy.txt +0 -50
- data/spec/support/active_record_data/4_0_diana.txt +0 -98
- data/spec/support/active_record_data/4_0_multi.txt +0 -198
- data/spec/support/active_record_data/4_1_diana.txt +0 -97
- data/spec/support/active_record_data/4_1_multi.txt +0 -196
- data/spec/support/active_record_data/4_2_diana.txt +0 -109
- data/spec/support/active_record_data/4_2_diana_legacy.txt +0 -109
- data/spec/support/active_record_data/4_2_multi.txt +0 -220
- data/spec/support/active_record_data/4_2_multi_legacy.txt +0 -220
@@ -19,21 +19,6 @@ module ExtVerifier
|
|
19
19
|
defined?(Mongoid)
|
20
20
|
end
|
21
21
|
module_function :has_mongoid?
|
22
|
-
|
23
|
-
def has_mongo_mapper?
|
24
|
-
defined?(MongoMapper)
|
25
|
-
end
|
26
|
-
module_function :has_mongo_mapper?
|
27
|
-
|
28
|
-
def has_ripple?
|
29
|
-
defined?(Ripple)
|
30
|
-
end
|
31
|
-
module_function :has_ripple?
|
32
|
-
|
33
|
-
def has_nobrainer?
|
34
|
-
defined?(NoBrainer)
|
35
|
-
end
|
36
|
-
module_function :has_nobrainer?
|
37
22
|
end
|
38
23
|
|
39
24
|
RSpec.configure do |config|
|
@@ -7,12 +7,12 @@ module MongoidVersions
|
|
7
7
|
Gem::Requirement.new('~> 4.0.0').satisfied_by?(mongoid_version)
|
8
8
|
end
|
9
9
|
|
10
|
-
def
|
11
|
-
Gem::Requirement.new('~>
|
10
|
+
def mongoid_5_0?
|
11
|
+
Gem::Requirement.new('~> 5.0.0').satisfied_by?(mongoid_version)
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
15
|
-
Gem::Requirement.new('~>
|
14
|
+
def mongoid_6_0?
|
15
|
+
Gem::Requirement.new('~> 6.0.0').satisfied_by?(mongoid_version)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -1,32 +1,22 @@
|
|
1
1
|
module RailsVersions
|
2
2
|
def rails_version
|
3
|
-
Gem::Version.new(Rails::VERSION::STRING)
|
3
|
+
Gem::Version.new(::Rails::VERSION::STRING)
|
4
4
|
end
|
5
5
|
|
6
|
-
def
|
7
|
-
Gem::Requirement.new('~> 5.
|
8
|
-
end
|
9
|
-
alias_method :activerecord_5_0?, :rails_5_0?
|
10
|
-
|
11
|
-
def rails_4_2?
|
12
|
-
Gem::Requirement.new('~> 4.2.0').satisfied_by?(rails_version)
|
6
|
+
def rails_5_2?
|
7
|
+
Gem::Requirement.new('~> 5.2.0').satisfied_by?(rails_version)
|
13
8
|
end
|
14
|
-
alias_method :
|
9
|
+
alias_method :activerecord_5_2?, :rails_5_2?
|
15
10
|
|
16
|
-
def
|
17
|
-
Gem::Requirement.new('~>
|
11
|
+
def rails_5_1?
|
12
|
+
Gem::Requirement.new('~> 5.1.0').satisfied_by?(rails_version)
|
18
13
|
end
|
19
|
-
alias_method :
|
14
|
+
alias_method :activerecord_5_1?, :rails_5_1?
|
20
15
|
|
21
|
-
def
|
22
|
-
Gem::Requirement.new('~>
|
23
|
-
end
|
24
|
-
alias_method :activerecord_4_0?, :rails_4_0?
|
25
|
-
|
26
|
-
def rails_3_2?
|
27
|
-
Gem::Requirement.new('~> 3.2.0').satisfied_by?(rails_version)
|
16
|
+
def rails_5_0?
|
17
|
+
Gem::Requirement.new('~> 5.0.0').satisfied_by?(rails_version)
|
28
18
|
end
|
29
|
-
alias_method :
|
19
|
+
alias_method :activerecord_5_0?, :rails_5_0?
|
30
20
|
end
|
31
21
|
|
32
22
|
RSpec.configure do |config|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awesome_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Michael Dvorkin
|
7
|
+
- Michael Dvorkin, James Cox & contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: fuubar
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,21 +39,21 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: appraisal
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: byebug
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,21 +67,21 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: fakefs
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.2.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.2.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: sqlite3
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,22 +95,22 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: nokogiri
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 1.6.5
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
111
|
-
description: 'Great Ruby
|
110
|
+
version: 1.6.5
|
111
|
+
description: 'Great Ruby debugging companion: pretty print Ruby objects to visualize
|
112
112
|
their structure. Supports custom object formatting via plugins'
|
113
|
-
email:
|
113
|
+
email:
|
114
114
|
executables: []
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
@@ -127,72 +127,88 @@ files:
|
|
127
127
|
- lib/ap.rb
|
128
128
|
- lib/awesome_print.rb
|
129
129
|
- lib/awesome_print/colorize.rb
|
130
|
+
- lib/awesome_print/core_ext/active_support.rb
|
130
131
|
- lib/awesome_print/core_ext/awesome_method_array.rb
|
131
132
|
- lib/awesome_print/core_ext/class.rb
|
132
133
|
- lib/awesome_print/core_ext/kernel.rb
|
133
134
|
- lib/awesome_print/core_ext/logger.rb
|
134
|
-
- lib/awesome_print/core_ext/method.rb
|
135
135
|
- lib/awesome_print/core_ext/object.rb
|
136
136
|
- lib/awesome_print/core_ext/string.rb
|
137
137
|
- lib/awesome_print/custom_defaults.rb
|
138
|
-
- lib/awesome_print/ext/action_view.rb
|
139
|
-
- lib/awesome_print/ext/active_record.rb
|
140
|
-
- lib/awesome_print/ext/active_support.rb
|
141
|
-
- lib/awesome_print/ext/mongo_mapper.rb
|
142
|
-
- lib/awesome_print/ext/mongoid.rb
|
143
|
-
- lib/awesome_print/ext/nobrainer.rb
|
144
|
-
- lib/awesome_print/ext/nokogiri.rb
|
145
|
-
- lib/awesome_print/ext/ostruct.rb
|
146
|
-
- lib/awesome_print/ext/ripple.rb
|
147
|
-
- lib/awesome_print/ext/sequel.rb
|
148
138
|
- lib/awesome_print/formatter.rb
|
149
139
|
- lib/awesome_print/formatters.rb
|
150
140
|
- lib/awesome_print/formatters/array_formatter.rb
|
151
141
|
- lib/awesome_print/formatters/base_formatter.rb
|
142
|
+
- lib/awesome_print/formatters/bigdecimal_formatter.rb
|
152
143
|
- lib/awesome_print/formatters/class_formatter.rb
|
153
144
|
- lib/awesome_print/formatters/dir_formatter.rb
|
145
|
+
- lib/awesome_print/formatters/ext/active_model_error_formatter.rb
|
146
|
+
- lib/awesome_print/formatters/ext/active_record_attributeset_formatter.rb
|
147
|
+
- lib/awesome_print/formatters/ext/active_record_class_formatter.rb
|
148
|
+
- lib/awesome_print/formatters/ext/active_record_instance_formatter.rb
|
149
|
+
- lib/awesome_print/formatters/ext/active_record_relation_formatter.rb
|
150
|
+
- lib/awesome_print/formatters/ext/bson_objectid_formatter.rb
|
151
|
+
- lib/awesome_print/formatters/ext/hash_with_indifferent_access_formatter.rb
|
152
|
+
- lib/awesome_print/formatters/ext/mongoid_document_formatter.rb
|
153
|
+
- lib/awesome_print/formatters/ext/nokogiri_document_formatter.rb
|
154
|
+
- lib/awesome_print/formatters/ext/nokogiri_node_formatter.rb
|
155
|
+
- lib/awesome_print/formatters/ext/nokogiri_nodeset_formatter.rb
|
156
|
+
- lib/awesome_print/formatters/ext/sequel_dataset_formatter.rb
|
157
|
+
- lib/awesome_print/formatters/ext/sequel_model_class_formatter.rb
|
158
|
+
- lib/awesome_print/formatters/ext/sequel_model_formatter.rb
|
159
|
+
- lib/awesome_print/formatters/ext/time_with_zone_formatter.rb
|
160
|
+
- lib/awesome_print/formatters/fallback_formatter.rb
|
161
|
+
- lib/awesome_print/formatters/false_class_formatter.rb
|
154
162
|
- lib/awesome_print/formatters/file_formatter.rb
|
155
163
|
- lib/awesome_print/formatters/hash_formatter.rb
|
164
|
+
- lib/awesome_print/formatters/integer_formatter.rb
|
156
165
|
- lib/awesome_print/formatters/method_formatter.rb
|
166
|
+
- lib/awesome_print/formatters/module_formatter.rb
|
167
|
+
- lib/awesome_print/formatters/nil_class_formatter.rb
|
157
168
|
- lib/awesome_print/formatters/object_formatter.rb
|
169
|
+
- lib/awesome_print/formatters/open_struct.rb
|
170
|
+
- lib/awesome_print/formatters/range_formatter.rb
|
171
|
+
- lib/awesome_print/formatters/rational_formatter.rb
|
172
|
+
- lib/awesome_print/formatters/set_formatter.rb
|
158
173
|
- lib/awesome_print/formatters/simple_formatter.rb
|
174
|
+
- lib/awesome_print/formatters/string_formatter.rb
|
159
175
|
- lib/awesome_print/formatters/struct_formatter.rb
|
176
|
+
- lib/awesome_print/formatters/symbol_formatter.rb
|
177
|
+
- lib/awesome_print/formatters/true_class_formatter.rb
|
178
|
+
- lib/awesome_print/formatters/unbound_method_formatter.rb
|
160
179
|
- lib/awesome_print/indentator.rb
|
161
180
|
- lib/awesome_print/inspector.rb
|
181
|
+
- lib/awesome_print/limiter.rb
|
182
|
+
- lib/awesome_print/registrar.rb
|
162
183
|
- lib/awesome_print/version.rb
|
163
184
|
- spec/active_record_helper.rb
|
164
185
|
- spec/colors_spec.rb
|
165
186
|
- spec/core_ext/logger_spec.rb
|
166
187
|
- spec/core_ext/string_spec.rb
|
167
|
-
- spec/
|
168
|
-
- spec/
|
169
|
-
- spec/
|
170
|
-
- spec/
|
171
|
-
- spec/ext/
|
172
|
-
- spec/ext/
|
173
|
-
- spec/ext/
|
174
|
-
- spec/ext/
|
175
|
-
- spec/
|
176
|
-
- spec/
|
177
|
-
- spec/
|
188
|
+
- spec/formatters/array_spec.rb
|
189
|
+
- spec/formatters/big_decimal_spec.rb
|
190
|
+
- spec/formatters/class_spec.rb
|
191
|
+
- spec/formatters/dir_file_spec.rb
|
192
|
+
- spec/formatters/ext/active_record_spec.rb
|
193
|
+
- spec/formatters/ext/active_support_spec.rb
|
194
|
+
- spec/formatters/ext/mongoid_spec.rb
|
195
|
+
- spec/formatters/ext/nokogiri_spec.rb
|
196
|
+
- spec/formatters/hash_spec.rb
|
197
|
+
- spec/formatters/methods_spec.rb
|
198
|
+
- spec/formatters/objects_spec.rb
|
199
|
+
- spec/formatters/ostruct_spec.rb
|
200
|
+
- spec/formatters/set_spec.rb
|
201
|
+
- spec/formatters/struct_spec.rb
|
202
|
+
- spec/merge_options_spec.rb
|
178
203
|
- spec/misc_spec.rb
|
179
|
-
- spec/objects_spec.rb
|
180
204
|
- spec/spec_helper.rb
|
181
205
|
- spec/support/active_record_data.rb
|
182
|
-
- spec/support/active_record_data/3_2_diana.txt
|
183
|
-
- spec/support/active_record_data/3_2_diana_legacy.txt
|
184
|
-
- spec/support/active_record_data/3_2_multi.txt
|
185
|
-
- spec/support/active_record_data/3_2_multi_legacy.txt
|
186
|
-
- spec/support/active_record_data/4_0_diana.txt
|
187
|
-
- spec/support/active_record_data/4_0_multi.txt
|
188
|
-
- spec/support/active_record_data/4_1_diana.txt
|
189
|
-
- spec/support/active_record_data/4_1_multi.txt
|
190
|
-
- spec/support/active_record_data/4_2_diana.txt
|
191
|
-
- spec/support/active_record_data/4_2_diana_legacy.txt
|
192
|
-
- spec/support/active_record_data/4_2_multi.txt
|
193
|
-
- spec/support/active_record_data/4_2_multi_legacy.txt
|
194
206
|
- spec/support/active_record_data/5_0_diana.txt
|
195
207
|
- spec/support/active_record_data/5_0_multi.txt
|
208
|
+
- spec/support/active_record_data/5_1_diana.txt
|
209
|
+
- spec/support/active_record_data/5_1_multi.txt
|
210
|
+
- spec/support/active_record_data/5_2_diana.txt
|
211
|
+
- spec/support/active_record_data/5_2_multi.txt
|
196
212
|
- spec/support/ext_verifier.rb
|
197
213
|
- spec/support/mongoid_versions.rb
|
198
214
|
- spec/support/rails_versions.rb
|
@@ -211,49 +227,44 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
211
227
|
version: '0'
|
212
228
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
213
229
|
requirements:
|
214
|
-
- - "
|
230
|
+
- - ">"
|
215
231
|
- !ruby/object:Gem::Version
|
216
|
-
version:
|
232
|
+
version: 1.3.1
|
217
233
|
requirements: []
|
218
|
-
rubyforge_project:
|
219
|
-
rubygems_version: 2.6.
|
234
|
+
rubyforge_project:
|
235
|
+
rubygems_version: 2.6.14.1
|
220
236
|
signing_key:
|
221
237
|
specification_version: 4
|
222
238
|
summary: Pretty print Ruby objects with proper indentation and colors
|
223
239
|
test_files:
|
224
|
-
- spec/
|
225
|
-
- spec/
|
240
|
+
- spec/spec_helper.rb
|
241
|
+
- spec/merge_options_spec.rb
|
226
242
|
- spec/core_ext/logger_spec.rb
|
227
243
|
- spec/core_ext/string_spec.rb
|
228
|
-
- spec/
|
229
|
-
- spec/
|
230
|
-
- spec/
|
231
|
-
- spec/
|
232
|
-
- spec/
|
233
|
-
- spec/ext/
|
234
|
-
- spec/ext/
|
235
|
-
- spec/ext/
|
236
|
-
- spec/ext/
|
237
|
-
- spec/
|
238
|
-
- spec/
|
239
|
-
- spec/
|
240
|
-
- spec/
|
241
|
-
- spec/
|
242
|
-
- spec/
|
243
|
-
- spec/
|
244
|
-
- spec/support/
|
245
|
-
- spec/support/active_record_data/3_2_multi_legacy.txt
|
246
|
-
- spec/support/active_record_data/4_0_diana.txt
|
247
|
-
- spec/support/active_record_data/4_0_multi.txt
|
248
|
-
- spec/support/active_record_data/4_1_diana.txt
|
249
|
-
- spec/support/active_record_data/4_1_multi.txt
|
250
|
-
- spec/support/active_record_data/4_2_diana.txt
|
251
|
-
- spec/support/active_record_data/4_2_diana_legacy.txt
|
252
|
-
- spec/support/active_record_data/4_2_multi.txt
|
253
|
-
- spec/support/active_record_data/4_2_multi_legacy.txt
|
254
|
-
- spec/support/active_record_data/5_0_diana.txt
|
244
|
+
- spec/colors_spec.rb
|
245
|
+
- spec/formatters/big_decimal_spec.rb
|
246
|
+
- spec/formatters/array_spec.rb
|
247
|
+
- spec/formatters/set_spec.rb
|
248
|
+
- spec/formatters/hash_spec.rb
|
249
|
+
- spec/formatters/ext/active_support_spec.rb
|
250
|
+
- spec/formatters/ext/mongoid_spec.rb
|
251
|
+
- spec/formatters/ext/active_record_spec.rb
|
252
|
+
- spec/formatters/ext/nokogiri_spec.rb
|
253
|
+
- spec/formatters/methods_spec.rb
|
254
|
+
- spec/formatters/dir_file_spec.rb
|
255
|
+
- spec/formatters/objects_spec.rb
|
256
|
+
- spec/formatters/struct_spec.rb
|
257
|
+
- spec/formatters/ostruct_spec.rb
|
258
|
+
- spec/formatters/class_spec.rb
|
259
|
+
- spec/active_record_helper.rb
|
260
|
+
- spec/support/mongoid_versions.rb
|
255
261
|
- spec/support/active_record_data/5_0_multi.txt
|
256
|
-
- spec/support/active_record_data.
|
262
|
+
- spec/support/active_record_data/5_2_diana.txt
|
263
|
+
- spec/support/active_record_data/5_1_multi.txt
|
264
|
+
- spec/support/active_record_data/5_1_diana.txt
|
265
|
+
- spec/support/active_record_data/5_2_multi.txt
|
266
|
+
- spec/support/active_record_data/5_0_diana.txt
|
257
267
|
- spec/support/ext_verifier.rb
|
258
|
-
- spec/support/mongoid_versions.rb
|
259
268
|
- spec/support/rails_versions.rb
|
269
|
+
- spec/support/active_record_data.rb
|
270
|
+
- spec/misc_spec.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# Copyright (c) 2010-2016 Michael Dvorkin and contributors
|
2
|
-
#
|
3
|
-
# Awesome Print is freely distributable under the terms of MIT license.
|
4
|
-
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
5
|
-
#------------------------------------------------------------------------------
|
6
|
-
#
|
7
|
-
# Method#name was intorduced in Ruby 1.8.7 so we define it here as necessary.
|
8
|
-
#
|
9
|
-
unless nil.method(:class).respond_to?(:name)
|
10
|
-
class Method
|
11
|
-
def name
|
12
|
-
inspect.split(/[#.>]/)[-1]
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
class UnboundMethod
|
17
|
-
def name
|
18
|
-
inspect.split(/[#.>]/)[-1]
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# Copyright (c) 2010-2016 Michael Dvorkin and contributors
|
2
|
-
#
|
3
|
-
# Awesome Print is freely distributable under the terms of MIT license.
|
4
|
-
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
5
|
-
#------------------------------------------------------------------------------
|
6
|
-
module AwesomePrint
|
7
|
-
module ActionView
|
8
|
-
# Use HTML colors and add default "debug_dump" class to the resulting HTML.
|
9
|
-
def ap_debug(object, options = {})
|
10
|
-
object.ai(
|
11
|
-
options.merge(html: true)
|
12
|
-
).sub(
|
13
|
-
/^<pre([\s>])/,
|
14
|
-
'<pre class="debug_dump"\\1'
|
15
|
-
)
|
16
|
-
end
|
17
|
-
|
18
|
-
alias ap ap_debug
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
ActionView::Base.send(:include, AwesomePrint::ActionView)
|
@@ -1,78 +0,0 @@
|
|
1
|
-
# Copyright (c) 2010-2016 Michael Dvorkin and contributors
|
2
|
-
#
|
3
|
-
# Awesome Print is freely distributable under the terms of MIT license.
|
4
|
-
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
5
|
-
#------------------------------------------------------------------------------
|
6
|
-
module AwesomePrint
|
7
|
-
module ActiveRecord
|
8
|
-
|
9
|
-
def self.included(base)
|
10
|
-
base.send :alias_method, :cast_without_active_record, :cast
|
11
|
-
base.send :alias_method, :cast, :cast_with_active_record
|
12
|
-
end
|
13
|
-
|
14
|
-
# Add ActiveRecord class names to the dispatcher pipeline.
|
15
|
-
#------------------------------------------------------------------------------
|
16
|
-
def cast_with_active_record(object, type)
|
17
|
-
cast = cast_without_active_record(object, type)
|
18
|
-
return cast if !defined?(::ActiveRecord::Base)
|
19
|
-
|
20
|
-
if object.is_a?(::ActiveRecord::Base)
|
21
|
-
cast = :active_record_instance
|
22
|
-
elsif object.is_a?(Class) && object.ancestors.include?(::ActiveRecord::Base)
|
23
|
-
cast = :active_record_class
|
24
|
-
elsif type == :activerecord_relation || object.class.ancestors.include?(::ActiveRecord::Relation)
|
25
|
-
cast = :array
|
26
|
-
end
|
27
|
-
cast
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
# Format ActiveRecord instance object.
|
33
|
-
#
|
34
|
-
# NOTE: by default only instance attributes (i.e. columns) are shown. To format
|
35
|
-
# ActiveRecord instance as regular object showing its instance variables and
|
36
|
-
# accessors use :raw => true option:
|
37
|
-
#
|
38
|
-
# ap record, :raw => true
|
39
|
-
#
|
40
|
-
#------------------------------------------------------------------------------
|
41
|
-
def awesome_active_record_instance(object)
|
42
|
-
return object.inspect if !defined?(::ActiveSupport::OrderedHash)
|
43
|
-
return awesome_object(object) if @options[:raw]
|
44
|
-
|
45
|
-
data = if object.class.column_names != object.attributes.keys
|
46
|
-
object.attributes
|
47
|
-
else
|
48
|
-
object.class.column_names.inject(::ActiveSupport::OrderedHash.new) do |hash, name|
|
49
|
-
if object.has_attribute?(name) || object.new_record?
|
50
|
-
value = object.respond_to?(name) ? object.send(name) : object.read_attribute(name)
|
51
|
-
hash[name.to_sym] = value
|
52
|
-
end
|
53
|
-
hash
|
54
|
-
end
|
55
|
-
end
|
56
|
-
"#{object} " << awesome_hash(data)
|
57
|
-
end
|
58
|
-
|
59
|
-
# Format ActiveRecord class object.
|
60
|
-
#------------------------------------------------------------------------------
|
61
|
-
def awesome_active_record_class(object)
|
62
|
-
return object.inspect if !defined?(::ActiveSupport::OrderedHash) || !object.respond_to?(:columns) || object.to_s == 'ActiveRecord::Base'
|
63
|
-
return awesome_class(object) if object.respond_to?(:abstract_class?) && object.abstract_class?
|
64
|
-
|
65
|
-
data = object.columns.inject(::ActiveSupport::OrderedHash.new) do |hash, c|
|
66
|
-
hash[c.name.to_sym] = c.type
|
67
|
-
hash
|
68
|
-
end
|
69
|
-
|
70
|
-
name = "class #{awesome_simple(object.to_s, :class)}"
|
71
|
-
base = "< #{awesome_simple(object.superclass.to_s, :class)}"
|
72
|
-
|
73
|
-
[name, base, awesome_hash(data)].join(' ')
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
AwesomePrint::Formatter.send(:include, AwesomePrint::ActiveRecord)
|