amazing_print 1.5.0 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +68 -38
  3. data/README.md +2 -2
  4. data/lib/amazing_print/core_ext/awesome_method_array.rb +1 -1
  5. data/lib/amazing_print/custom_defaults.rb +7 -1
  6. data/lib/amazing_print/ext/active_record.rb +32 -2
  7. data/lib/amazing_print/ext/mongoid.rb +14 -2
  8. data/lib/amazing_print/ext/nobrainer.rb +2 -2
  9. data/lib/amazing_print/ext_loader.rb +27 -0
  10. data/lib/amazing_print/formatters/base_formatter.rb +12 -3
  11. data/lib/amazing_print/formatters/hash_formatter.rb +28 -11
  12. data/lib/amazing_print/formatters/mswin_helper.rb +4 -4
  13. data/lib/amazing_print/formatters/object_formatter.rb +1 -1
  14. data/lib/amazing_print/formatters/struct_formatter.rb +1 -1
  15. data/lib/amazing_print/inspector.rb +6 -3
  16. data/lib/amazing_print/version.rb +1 -1
  17. data/lib/amazing_print.rb +2 -8
  18. metadata +7 -61
  19. data/.gitignore +0 -35
  20. data/Appraisals +0 -50
  21. data/Gemfile +0 -15
  22. data/Gemfile.lock +0 -83
  23. data/LICENSE +0 -22
  24. data/Rakefile +0 -25
  25. data/spec/active_record_helper.rb +0 -43
  26. data/spec/colors_spec.rb +0 -120
  27. data/spec/core_ext/logger_spec.rb +0 -70
  28. data/spec/ext/action_controller_spec.rb +0 -40
  29. data/spec/ext/action_view_spec.rb +0 -24
  30. data/spec/ext/active_model_spec.rb +0 -37
  31. data/spec/ext/active_record_spec.rb +0 -298
  32. data/spec/ext/active_support_spec.rb +0 -37
  33. data/spec/ext/mongo_mapper_spec.rb +0 -265
  34. data/spec/ext/mongoid_spec.rb +0 -72
  35. data/spec/ext/nobrainer_spec.rb +0 -64
  36. data/spec/ext/nokogiri_spec.rb +0 -52
  37. data/spec/ext/ostruct_spec.rb +0 -24
  38. data/spec/ext/ripple_spec.rb +0 -53
  39. data/spec/ext/sequel_spec.rb +0 -45
  40. data/spec/formats_spec.rb +0 -792
  41. data/spec/methods_spec.rb +0 -520
  42. data/spec/misc_spec.rb +0 -206
  43. data/spec/objects_spec.rb +0 -225
  44. data/spec/sequel_helper.rb +0 -18
  45. data/spec/spec_helper.rb +0 -112
  46. data/spec/support/active_record_data/3_2_diana.txt +0 -24
  47. data/spec/support/active_record_data/3_2_diana_legacy.txt +0 -24
  48. data/spec/support/active_record_data/3_2_multi.txt +0 -50
  49. data/spec/support/active_record_data/3_2_multi_legacy.txt +0 -50
  50. data/spec/support/active_record_data/4_0_diana.txt +0 -98
  51. data/spec/support/active_record_data/4_0_multi.txt +0 -198
  52. data/spec/support/active_record_data/4_1_diana.txt +0 -97
  53. data/spec/support/active_record_data/4_1_multi.txt +0 -196
  54. data/spec/support/active_record_data/4_2_diana.txt +0 -109
  55. data/spec/support/active_record_data/4_2_diana_legacy.txt +0 -109
  56. data/spec/support/active_record_data/4_2_multi.txt +0 -220
  57. data/spec/support/active_record_data/4_2_multi_legacy.txt +0 -220
  58. data/spec/support/active_record_data/5_0_diana.txt +0 -105
  59. data/spec/support/active_record_data/5_0_multi.txt +0 -212
  60. data/spec/support/active_record_data/5_1_diana.txt +0 -104
  61. data/spec/support/active_record_data/5_1_multi.txt +0 -210
  62. data/spec/support/active_record_data/5_2_diana.txt +0 -104
  63. data/spec/support/active_record_data/5_2_multi.txt +0 -210
  64. data/spec/support/active_record_data/6_0_diana.txt +0 -104
  65. data/spec/support/active_record_data/6_0_multi.txt +0 -210
  66. data/spec/support/active_record_data/6_1_diana.txt +0 -109
  67. data/spec/support/active_record_data/6_1_multi.txt +0 -220
  68. data/spec/support/active_record_data.rb +0 -22
  69. data/spec/support/ext_verifier.rb +0 -46
  70. data/spec/support/mongoid_versions.rb +0 -24
  71. data/spec/support/rails_versions.rb +0 -57
@@ -1,109 +0,0 @@
1
- #<User:placeholder_id
2
- @_start_transaction_state = nil,
3
- @association_cache = {},
4
- @destroyed = false,
5
- @marked_for_destruction = false,
6
- @new_record = true,
7
- @previously_new_record = false,
8
- @primary_key = "id",
9
- @readonly = false,
10
- @strict_loading = false,
11
- attr_accessor :attributes = #<ActiveModel::AttributeSet:placeholder_id
12
- @attributes = {
13
- "admin" => #<ActiveModel::Attribute::FromUser:placeholder_id
14
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
15
- @original_attribute = nil,
16
- attr_reader :name = "admin",
17
- attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
18
- attr_reader :limit = nil,
19
- attr_reader :precision = nil,
20
- attr_reader :scale = nil
21
- >,
22
- attr_reader :value_before_type_cast = nil
23
- >,
24
- attr_reader :name = "admin",
25
- attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
26
- attr_reader :limit = nil,
27
- attr_reader :precision = nil,
28
- attr_reader :scale = nil
29
- >,
30
- attr_reader :value_before_type_cast = false
31
- >,
32
- "created_at" => #<ActiveModel::Attribute::FromUser:placeholder_id
33
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
34
- @original_attribute = nil,
35
- attr_reader :name = "created_at",
36
- attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
37
- attr_reader :limit = nil,
38
- attr_reader :precision = nil,
39
- attr_reader :scale = nil
40
- >,
41
- attr_reader :value_before_type_cast = nil
42
- >,
43
- attr_reader :name = "created_at",
44
- attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
45
- attr_reader :limit = nil,
46
- attr_reader :precision = nil,
47
- attr_reader :scale = nil
48
- >,
49
- attr_reader :value_before_type_cast = "1992-10-10 12:30:00"
50
- >,
51
- "id" => #<ActiveModel::Attribute::FromDatabase:placeholder_id
52
- @original_attribute = nil,
53
- attr_reader :name = "id",
54
- attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
55
- @range = -9223372036854775808...9223372036854775808,
56
- attr_reader :limit = nil,
57
- attr_reader :precision = nil,
58
- attr_reader :scale = nil
59
- >,
60
- attr_reader :value_before_type_cast = nil
61
- >,
62
- "name" => #<ActiveModel::Attribute::FromUser:placeholder_id
63
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
64
- @original_attribute = nil,
65
- attr_reader :name = "name",
66
- attr_reader :type = #<ActiveModel::Type::String:placeholder_id
67
- @false = "f",
68
- @true = "t",
69
- attr_reader :limit = nil,
70
- attr_reader :precision = nil,
71
- attr_reader :scale = nil
72
- >,
73
- attr_reader :value_before_type_cast = nil
74
- >,
75
- attr_reader :name = "name",
76
- attr_reader :type = #<ActiveModel::Type::String:placeholder_id
77
- @false = "f",
78
- @true = "t",
79
- attr_reader :limit = nil,
80
- attr_reader :precision = nil,
81
- attr_reader :scale = nil
82
- >,
83
- attr_reader :value_before_type_cast = "Diana"
84
- >,
85
- "rank" => #<ActiveModel::Attribute::FromUser:placeholder_id
86
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
87
- @original_attribute = nil,
88
- attr_reader :name = "rank",
89
- attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
90
- @range = -9223372036854775808...9223372036854775808,
91
- attr_reader :limit = nil,
92
- attr_reader :precision = nil,
93
- attr_reader :scale = nil
94
- >,
95
- attr_reader :value_before_type_cast = nil
96
- >,
97
- attr_reader :name = "rank",
98
- attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
99
- @range = -9223372036854775808...9223372036854775808,
100
- attr_reader :limit = nil,
101
- attr_reader :precision = nil,
102
- attr_reader :scale = nil
103
- >,
104
- attr_reader :value_before_type_cast = 1
105
- >
106
- }
107
- >,
108
- attr_accessor :destroyed_by_association = nil
109
- >
@@ -1,220 +0,0 @@
1
- [
2
- [0] #<User:placeholder_id
3
- @_start_transaction_state = nil,
4
- @association_cache = {},
5
- @destroyed = false,
6
- @marked_for_destruction = false,
7
- @new_record = true,
8
- @previously_new_record = false,
9
- @primary_key = "id",
10
- @readonly = false,
11
- @strict_loading = false,
12
- attr_accessor :attributes = #<ActiveModel::AttributeSet:placeholder_id
13
- @attributes = {
14
- "admin" => #<ActiveModel::Attribute::FromUser:placeholder_id
15
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
16
- @original_attribute = nil,
17
- attr_reader :name = "admin",
18
- attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
19
- attr_reader :limit = nil,
20
- attr_reader :precision = nil,
21
- attr_reader :scale = nil
22
- >,
23
- attr_reader :value_before_type_cast = nil
24
- >,
25
- attr_reader :name = "admin",
26
- attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
27
- attr_reader :limit = nil,
28
- attr_reader :precision = nil,
29
- attr_reader :scale = nil
30
- >,
31
- attr_reader :value_before_type_cast = false
32
- >,
33
- "created_at" => #<ActiveModel::Attribute::FromUser:placeholder_id
34
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
35
- @original_attribute = nil,
36
- attr_reader :name = "created_at",
37
- attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
38
- attr_reader :limit = nil,
39
- attr_reader :precision = nil,
40
- attr_reader :scale = nil
41
- >,
42
- attr_reader :value_before_type_cast = nil
43
- >,
44
- attr_reader :name = "created_at",
45
- attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
46
- attr_reader :limit = nil,
47
- attr_reader :precision = nil,
48
- attr_reader :scale = nil
49
- >,
50
- attr_reader :value_before_type_cast = "1992-10-10 12:30:00"
51
- >,
52
- "id" => #<ActiveModel::Attribute::FromDatabase:placeholder_id
53
- @original_attribute = nil,
54
- attr_reader :name = "id",
55
- attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
56
- @range = -9223372036854775808...9223372036854775808,
57
- attr_reader :limit = nil,
58
- attr_reader :precision = nil,
59
- attr_reader :scale = nil
60
- >,
61
- attr_reader :value_before_type_cast = nil
62
- >,
63
- "name" => #<ActiveModel::Attribute::FromUser:placeholder_id
64
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
65
- @original_attribute = nil,
66
- attr_reader :name = "name",
67
- attr_reader :type = #<ActiveModel::Type::String:placeholder_id
68
- @false = "f",
69
- @true = "t",
70
- attr_reader :limit = nil,
71
- attr_reader :precision = nil,
72
- attr_reader :scale = nil
73
- >,
74
- attr_reader :value_before_type_cast = nil
75
- >,
76
- attr_reader :name = "name",
77
- attr_reader :type = #<ActiveModel::Type::String:placeholder_id
78
- @false = "f",
79
- @true = "t",
80
- attr_reader :limit = nil,
81
- attr_reader :precision = nil,
82
- attr_reader :scale = nil
83
- >,
84
- attr_reader :value_before_type_cast = "Diana"
85
- >,
86
- "rank" => #<ActiveModel::Attribute::FromUser:placeholder_id
87
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
88
- @original_attribute = nil,
89
- attr_reader :name = "rank",
90
- attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
91
- @range = -9223372036854775808...9223372036854775808,
92
- attr_reader :limit = nil,
93
- attr_reader :precision = nil,
94
- attr_reader :scale = nil
95
- >,
96
- attr_reader :value_before_type_cast = nil
97
- >,
98
- attr_reader :name = "rank",
99
- attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
100
- @range = -9223372036854775808...9223372036854775808,
101
- attr_reader :limit = nil,
102
- attr_reader :precision = nil,
103
- attr_reader :scale = nil
104
- >,
105
- attr_reader :value_before_type_cast = 1
106
- >
107
- }
108
- >,
109
- attr_accessor :destroyed_by_association = nil
110
- >,
111
- [1] #<User:placeholder_id
112
- @_start_transaction_state = nil,
113
- @association_cache = {},
114
- @destroyed = false,
115
- @marked_for_destruction = false,
116
- @new_record = true,
117
- @previously_new_record = false,
118
- @primary_key = "id",
119
- @readonly = false,
120
- @strict_loading = false,
121
- attr_accessor :attributes = #<ActiveModel::AttributeSet:placeholder_id
122
- @attributes = {
123
- "admin" => #<ActiveModel::Attribute::FromUser:placeholder_id
124
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
125
- @original_attribute = nil,
126
- attr_reader :name = "admin",
127
- attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
128
- attr_reader :limit = nil,
129
- attr_reader :precision = nil,
130
- attr_reader :scale = nil
131
- >,
132
- attr_reader :value_before_type_cast = nil
133
- >,
134
- attr_reader :name = "admin",
135
- attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
136
- attr_reader :limit = nil,
137
- attr_reader :precision = nil,
138
- attr_reader :scale = nil
139
- >,
140
- attr_reader :value_before_type_cast = true
141
- >,
142
- "created_at" => #<ActiveModel::Attribute::FromUser:placeholder_id
143
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
144
- @original_attribute = nil,
145
- attr_reader :name = "created_at",
146
- attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
147
- attr_reader :limit = nil,
148
- attr_reader :precision = nil,
149
- attr_reader :scale = nil
150
- >,
151
- attr_reader :value_before_type_cast = nil
152
- >,
153
- attr_reader :name = "created_at",
154
- attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
155
- attr_reader :limit = nil,
156
- attr_reader :precision = nil,
157
- attr_reader :scale = nil
158
- >,
159
- attr_reader :value_before_type_cast = "2003-05-26 14:15:00"
160
- >,
161
- "id" => #<ActiveModel::Attribute::FromDatabase:placeholder_id
162
- @original_attribute = nil,
163
- attr_reader :name = "id",
164
- attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
165
- @range = -9223372036854775808...9223372036854775808,
166
- attr_reader :limit = nil,
167
- attr_reader :precision = nil,
168
- attr_reader :scale = nil
169
- >,
170
- attr_reader :value_before_type_cast = nil
171
- >,
172
- "name" => #<ActiveModel::Attribute::FromUser:placeholder_id
173
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
174
- @original_attribute = nil,
175
- attr_reader :name = "name",
176
- attr_reader :type = #<ActiveModel::Type::String:placeholder_id
177
- @false = "f",
178
- @true = "t",
179
- attr_reader :limit = nil,
180
- attr_reader :precision = nil,
181
- attr_reader :scale = nil
182
- >,
183
- attr_reader :value_before_type_cast = nil
184
- >,
185
- attr_reader :name = "name",
186
- attr_reader :type = #<ActiveModel::Type::String:placeholder_id
187
- @false = "f",
188
- @true = "t",
189
- attr_reader :limit = nil,
190
- attr_reader :precision = nil,
191
- attr_reader :scale = nil
192
- >,
193
- attr_reader :value_before_type_cast = "Laura"
194
- >,
195
- "rank" => #<ActiveModel::Attribute::FromUser:placeholder_id
196
- @original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
197
- @original_attribute = nil,
198
- attr_reader :name = "rank",
199
- attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
200
- @range = -9223372036854775808...9223372036854775808,
201
- attr_reader :limit = nil,
202
- attr_reader :precision = nil,
203
- attr_reader :scale = nil
204
- >,
205
- attr_reader :value_before_type_cast = nil
206
- >,
207
- attr_reader :name = "rank",
208
- attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
209
- @range = -9223372036854775808...9223372036854775808,
210
- attr_reader :limit = nil,
211
- attr_reader :precision = nil,
212
- attr_reader :scale = nil
213
- >,
214
- attr_reader :value_before_type_cast = 2
215
- >
216
- }
217
- >,
218
- attr_accessor :destroyed_by_association = nil
219
- >
220
- ]
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'pathname'
4
-
5
- class ActiveRecordData
6
- class << self
7
- data_file_selector = Pathname(File.dirname(__FILE__)).join('active_record_data', '*.txt')
8
-
9
- # Example generated method
10
- # data_filename = '/path/to/ap/spec/support/active_record_data/4_2_diana.txt'
11
- #
12
- # def self.raw_4_2_dana
13
- # File.read(data_filename).strip
14
- # end
15
- Dir[data_file_selector].each do |data_filename|
16
- method_name = Pathname(data_filename).basename('.txt')
17
- define_method(:"raw_#{method_name}") do
18
- File.read(data_filename).strip
19
- end
20
- end
21
- end
22
- end
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ExtVerifier
4
- def require_dependencies!(dependencies)
5
- dependencies.each do |dependency|
6
- require dependency
7
- rescue LoadError
8
- end
9
- end
10
- module_function :require_dependencies!
11
-
12
- def has_rails?
13
- defined?(Rails)
14
- end
15
- module_function :has_rails?
16
-
17
- def has_mongoid?
18
- defined?(Mongoid)
19
- end
20
- module_function :has_mongoid?
21
-
22
- def has_mongo_mapper?
23
- defined?(MongoMapper)
24
- end
25
- module_function :has_mongo_mapper?
26
-
27
- def has_ripple?
28
- defined?(Ripple)
29
- end
30
- module_function :has_ripple?
31
-
32
- def has_nobrainer?
33
- defined?(NoBrainer)
34
- end
35
- module_function :has_nobrainer?
36
-
37
- def has_sequel?
38
- defined?(::Sequel::Model)
39
- end
40
- module_function :has_sequel?
41
- end
42
-
43
- RSpec.configure do |config|
44
- config.include(ExtVerifier)
45
- config.extend(ExtVerifier)
46
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module MongoidVersions
4
- def mongoid_version
5
- Gem::Version.new(Mongoid::VERSION)
6
- end
7
-
8
- def mongoid_4_0?
9
- Gem::Requirement.new('~> 4.0.0').satisfied_by?(mongoid_version)
10
- end
11
-
12
- def mongoid_5_0?
13
- Gem::Requirement.new('~> 5.0.0').satisfied_by?(mongoid_version)
14
- end
15
-
16
- def mongoid_6_0?
17
- Gem::Requirement.new('~> 6.0.0').satisfied_by?(mongoid_version)
18
- end
19
- end
20
-
21
- RSpec.configure do |config|
22
- config.include(MongoidVersions)
23
- config.extend(MongoidVersions)
24
- end
@@ -1,57 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RailsVersions
4
- def rails_version
5
- Gem::Version.new(Rails::VERSION::STRING)
6
- end
7
-
8
- def rails_6_1?
9
- Gem::Requirement.new('~> 6.1.0').satisfied_by?(rails_version)
10
- end
11
- alias activerecord_6_1? rails_6_1?
12
-
13
- def rails_6_0?
14
- Gem::Requirement.new('~> 6.0.0').satisfied_by?(rails_version)
15
- end
16
- alias activerecord_6_0? rails_6_0?
17
-
18
- def rails_5_2?
19
- Gem::Requirement.new('~> 5.2.0').satisfied_by?(rails_version)
20
- end
21
- alias activerecord_5_2? rails_5_2?
22
-
23
- def rails_5_1?
24
- Gem::Requirement.new('~> 5.1.0').satisfied_by?(rails_version)
25
- end
26
- alias activerecord_5_1? rails_5_1?
27
-
28
- def rails_5_0?
29
- Gem::Requirement.new('~> 5.0.0.racecar1').satisfied_by?(rails_version)
30
- end
31
- alias activerecord_5_0? rails_5_0?
32
-
33
- def rails_4_2?
34
- Gem::Requirement.new('~> 4.2.0').satisfied_by?(rails_version)
35
- end
36
- alias activerecord_4_2? rails_4_2?
37
-
38
- def rails_4_1?
39
- Gem::Requirement.new('~> 4.1.0').satisfied_by?(rails_version)
40
- end
41
- alias activerecord_4_1? rails_4_1?
42
-
43
- def rails_4_0?
44
- Gem::Requirement.new('~> 4.0.0').satisfied_by?(rails_version)
45
- end
46
- alias activerecord_4_0? rails_4_0?
47
-
48
- def rails_3_2?
49
- Gem::Requirement.new('~> 3.2.0').satisfied_by?(rails_version)
50
- end
51
- alias activerecord_3_2? rails_3_2?
52
- end
53
-
54
- RSpec.configure do |config|
55
- config.include(RailsVersions)
56
- config.extend(RailsVersions)
57
- end