awesome_print 1.2.0 → 1.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -2
  3. data/Appraisals +62 -0
  4. data/CHANGELOG.md +180 -0
  5. data/CONTRIBUTING.md +82 -0
  6. data/Gemfile +3 -2
  7. data/LICENSE +16 -19
  8. data/README.md +112 -87
  9. data/Rakefile +17 -4
  10. data/awesome_print.gemspec +33 -0
  11. data/init.rb +1 -0
  12. data/lib/ap.rb +2 -2
  13. data/lib/awesome_print.rb +22 -16
  14. data/lib/awesome_print/colorize.rb +24 -0
  15. data/lib/awesome_print/core_ext/{array.rb → awesome_method_array.rb} +16 -18
  16. data/lib/awesome_print/core_ext/class.rb +3 -2
  17. data/lib/awesome_print/core_ext/kernel.rb +1 -1
  18. data/lib/awesome_print/core_ext/logger.rb +1 -1
  19. data/lib/awesome_print/core_ext/method.rb +2 -2
  20. data/lib/awesome_print/core_ext/object.rb +3 -2
  21. data/lib/awesome_print/core_ext/string.rb +3 -3
  22. data/lib/awesome_print/custom_defaults.rb +57 -0
  23. data/lib/awesome_print/ext/action_view.rb +8 -4
  24. data/lib/awesome_print/ext/active_record.rb +47 -13
  25. data/lib/awesome_print/ext/active_support.rb +1 -1
  26. data/lib/awesome_print/ext/mongo_mapper.rb +16 -13
  27. data/lib/awesome_print/ext/mongoid.rb +9 -7
  28. data/lib/awesome_print/ext/nobrainer.rb +52 -0
  29. data/lib/awesome_print/ext/nokogiri.rb +4 -4
  30. data/lib/awesome_print/ext/ostruct.rb +27 -0
  31. data/lib/awesome_print/ext/ripple.rb +6 -7
  32. data/lib/awesome_print/ext/sequel.rb +7 -6
  33. data/lib/awesome_print/formatter.rb +54 -327
  34. data/lib/awesome_print/formatters.rb +15 -0
  35. data/lib/awesome_print/formatters/array_formatter.rb +139 -0
  36. data/lib/awesome_print/formatters/base_formatter.rb +140 -0
  37. data/lib/awesome_print/formatters/class_formatter.rb +25 -0
  38. data/lib/awesome_print/formatters/dir_formatter.rb +22 -0
  39. data/lib/awesome_print/formatters/file_formatter.rb +22 -0
  40. data/lib/awesome_print/formatters/hash_formatter.rb +106 -0
  41. data/lib/awesome_print/formatters/method_formatter.rb +22 -0
  42. data/lib/awesome_print/formatters/object_formatter.rb +78 -0
  43. data/lib/awesome_print/formatters/simple_formatter.rb +21 -0
  44. data/lib/awesome_print/formatters/struct_formatter.rb +71 -0
  45. data/lib/awesome_print/indentator.rb +18 -0
  46. data/lib/awesome_print/inspector.rb +92 -94
  47. data/lib/awesome_print/version.rb +2 -2
  48. data/spec/active_record_helper.rb +30 -0
  49. data/spec/colors_spec.rb +31 -31
  50. data/spec/core_ext/logger_spec.rb +43 -0
  51. data/spec/core_ext/string_spec.rb +20 -0
  52. data/spec/ext/action_view_spec.rb +21 -0
  53. data/spec/ext/active_record_spec.rb +260 -0
  54. data/spec/ext/active_support_spec.rb +30 -0
  55. data/spec/ext/mongo_mapper_spec.rb +261 -0
  56. data/spec/ext/mongoid_spec.rb +67 -0
  57. data/spec/ext/nobrainer_spec.rb +59 -0
  58. data/spec/ext/nokogiri_spec.rb +46 -0
  59. data/spec/ext/ostruct_spec.rb +22 -0
  60. data/spec/ext/ripple_spec.rb +48 -0
  61. data/spec/formats_spec.rb +272 -205
  62. data/spec/methods_spec.rb +173 -177
  63. data/spec/misc_spec.rb +129 -105
  64. data/spec/objects_spec.rb +162 -27
  65. data/spec/spec_helper.rb +75 -37
  66. data/spec/support/active_record_data.rb +20 -0
  67. data/spec/support/active_record_data/3_2_diana.txt +24 -0
  68. data/spec/support/active_record_data/3_2_diana_legacy.txt +24 -0
  69. data/spec/support/active_record_data/3_2_multi.txt +50 -0
  70. data/spec/support/active_record_data/3_2_multi_legacy.txt +50 -0
  71. data/spec/support/active_record_data/4_0_diana.txt +98 -0
  72. data/spec/support/active_record_data/4_0_multi.txt +198 -0
  73. data/spec/support/active_record_data/4_1_diana.txt +97 -0
  74. data/spec/support/active_record_data/4_1_multi.txt +196 -0
  75. data/spec/support/active_record_data/4_2_diana.txt +109 -0
  76. data/spec/support/active_record_data/4_2_diana_legacy.txt +109 -0
  77. data/spec/support/active_record_data/4_2_multi.txt +220 -0
  78. data/spec/support/active_record_data/4_2_multi_legacy.txt +220 -0
  79. data/spec/support/active_record_data/5_0_diana.txt +105 -0
  80. data/spec/support/active_record_data/5_0_multi.txt +212 -0
  81. data/spec/support/active_record_data/5_1_diana.txt +104 -0
  82. data/spec/support/active_record_data/5_1_multi.txt +210 -0
  83. data/spec/support/active_record_data/5_2_diana.txt +104 -0
  84. data/spec/support/active_record_data/5_2_multi.txt +210 -0
  85. data/spec/support/active_record_data/6_0_diana.txt +104 -0
  86. data/spec/support/active_record_data/6_0_multi.txt +210 -0
  87. data/spec/support/active_record_data/6_1_diana.txt +109 -0
  88. data/spec/support/active_record_data/6_1_multi.txt +220 -0
  89. data/spec/support/ext_verifier.rb +42 -0
  90. data/spec/support/mongoid_versions.rb +26 -0
  91. data/spec/support/rails_versions.rb +55 -0
  92. metadata +163 -32
  93. data/CHANGELOG +0 -96
  94. data/lib/awesome_print/ext/no_brainer.rb +0 -58
@@ -0,0 +1,109 @@
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
+ >
@@ -0,0 +1,220 @@
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
+ ]
@@ -0,0 +1,42 @@
1
+ module ExtVerifier
2
+
3
+ def require_dependencies!(dependencies)
4
+ dependencies.each do |dependency|
5
+ begin
6
+ require dependency
7
+ rescue LoadError
8
+ end
9
+ end
10
+ end
11
+ module_function :require_dependencies!
12
+
13
+ def has_rails?
14
+ defined?(Rails)
15
+ end
16
+ module_function :has_rails?
17
+
18
+ def has_mongoid?
19
+ defined?(Mongoid)
20
+ end
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
+ end
38
+
39
+ RSpec.configure do |config|
40
+ config.include(ExtVerifier)
41
+ config.extend(ExtVerifier)
42
+ end
@@ -0,0 +1,26 @@
1
+ module MongoidVersions
2
+ def mongoid_version
3
+ Gem::Version.new(Mongoid::VERSION)
4
+ end
5
+
6
+ def mongoid_5_0?
7
+ Gem::Requirement.new('~> 5.0.0').satisfied_by?(mongoid_version)
8
+ end
9
+
10
+ def mongoid_6_0?
11
+ Gem::Requirement.new('~> 6.0.0').satisfied_by?(mongoid_version)
12
+ end
13
+
14
+ def mongoid_7_0?
15
+ Gem::Requirement.new('~> 7.0.0').satisfied_by?(mongoid_version)
16
+ end
17
+
18
+ def mongoid_7_1?
19
+ Gem::Requirement.new('~> 7.1.0').satisfied_by?(mongoid_version)
20
+ end
21
+ end
22
+
23
+ RSpec.configure do |config|
24
+ config.include(MongoidVersions)
25
+ config.extend(MongoidVersions)
26
+ end
@@ -0,0 +1,55 @@
1
+ module RailsVersions
2
+ def rails_version
3
+ Gem::Version.new(Rails::VERSION::STRING)
4
+ end
5
+
6
+ def rails_6_1?
7
+ Gem::Requirement.new('~> 6.1.0').satisfied_by?(rails_version)
8
+ end
9
+ alias_method :activerecord_6_1?, :rails_6_1?
10
+
11
+ def rails_6_0?
12
+ Gem::Requirement.new('~> 6.0.0').satisfied_by?(rails_version)
13
+ end
14
+ alias_method :activerecord_6_0?, :rails_6_0?
15
+
16
+ def rails_5_2?
17
+ Gem::Requirement.new('~> 5.2.0').satisfied_by?(rails_version)
18
+ end
19
+ alias_method :activerecord_5_2?, :rails_5_2?
20
+
21
+ def rails_5_1?
22
+ Gem::Requirement.new('~> 5.1.0').satisfied_by?(rails_version)
23
+ end
24
+ alias_method :activerecord_5_1?, :rails_5_1?
25
+
26
+ def rails_5_0?
27
+ Gem::Requirement.new('~> 5.0.0.racecar1').satisfied_by?(rails_version)
28
+ end
29
+ alias_method :activerecord_5_0?, :rails_5_0?
30
+
31
+ def rails_4_2?
32
+ Gem::Requirement.new('~> 4.2.0').satisfied_by?(rails_version)
33
+ end
34
+ alias_method :activerecord_4_2?, :rails_4_2?
35
+
36
+ def rails_4_1?
37
+ Gem::Requirement.new('~> 4.1.0').satisfied_by?(rails_version)
38
+ end
39
+ alias_method :activerecord_4_1?, :rails_4_1?
40
+
41
+ def rails_4_0?
42
+ Gem::Requirement.new('~> 4.0.0').satisfied_by?(rails_version)
43
+ end
44
+ alias_method :activerecord_4_0?, :rails_4_0?
45
+
46
+ def rails_3_2?
47
+ Gem::Requirement.new('~> 3.2.0').satisfied_by?(rails_version)
48
+ end
49
+ alias_method :activerecord_3_2?, :rails_3_2?
50
+ end
51
+
52
+ RSpec.configure do |config|
53
+ config.include(RailsVersions)
54
+ config.extend(RailsVersions)
55
+ end