ros-apartment 2.3.0.alpha1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/.pryrc +5 -3
  3. data/.rubocop.yml +36 -0
  4. data/.rubocop_todo.yml +439 -0
  5. data/.ruby-version +1 -0
  6. data/Appraisals +31 -52
  7. data/CHANGELOG.md +965 -0
  8. data/Gemfile +2 -7
  9. data/Guardfile +3 -16
  10. data/README.md +121 -44
  11. data/Rakefile +42 -31
  12. data/lib/apartment/active_record/connection_handling.rb +31 -0
  13. data/lib/apartment/active_record/internal_metadata.rb +9 -0
  14. data/lib/apartment/active_record/postgresql_adapter.rb +43 -0
  15. data/lib/apartment/active_record/schema_migration.rb +11 -0
  16. data/lib/apartment/adapters/abstract_adapter.rb +52 -46
  17. data/lib/apartment/adapters/abstract_jdbc_adapter.rb +5 -3
  18. data/lib/apartment/adapters/jdbc_mysql_adapter.rb +3 -3
  19. data/lib/apartment/adapters/jdbc_postgresql_adapter.rb +19 -13
  20. data/lib/apartment/adapters/mysql2_adapter.rb +15 -9
  21. data/lib/apartment/adapters/postgis_adapter.rb +3 -2
  22. data/lib/apartment/adapters/postgresql_adapter.rb +79 -31
  23. data/lib/apartment/adapters/sqlite3_adapter.rb +18 -8
  24. data/lib/apartment/adapters/trilogy_adapter.rb +29 -0
  25. data/lib/apartment/console.rb +23 -11
  26. data/lib/apartment/custom_console.rb +42 -0
  27. data/lib/apartment/deprecation.rb +2 -1
  28. data/lib/apartment/elevators/domain.rb +4 -3
  29. data/lib/apartment/elevators/first_subdomain.rb +3 -2
  30. data/lib/apartment/elevators/generic.rb +4 -3
  31. data/lib/apartment/elevators/host.rb +6 -1
  32. data/lib/apartment/elevators/host_hash.rb +6 -2
  33. data/lib/apartment/elevators/subdomain.rb +9 -5
  34. data/lib/apartment/log_subscriber.rb +45 -0
  35. data/lib/apartment/migrator.rb +7 -24
  36. data/lib/apartment/model.rb +29 -0
  37. data/lib/apartment/railtie.rb +21 -20
  38. data/lib/apartment/tasks/enhancements.rb +4 -6
  39. data/lib/apartment/tasks/task_helper.rb +52 -0
  40. data/lib/apartment/tenant.rb +7 -10
  41. data/lib/apartment/version.rb +3 -1
  42. data/lib/apartment.rb +46 -15
  43. data/lib/generators/apartment/install/install_generator.rb +4 -3
  44. data/lib/generators/apartment/install/templates/apartment.rb +10 -3
  45. data/lib/tasks/apartment.rake +48 -87
  46. data/ros-apartment.gemspec +65 -0
  47. metadata +181 -264
  48. data/.github/ISSUE_TEMPLATE.md +0 -21
  49. data/.travis.yml +0 -65
  50. data/HISTORY.md +0 -398
  51. data/TODO.md +0 -51
  52. data/apartment.gemspec +0 -46
  53. data/docker-compose.yml +0 -33
  54. data/gemfiles/rails_4_2.gemfile +0 -23
  55. data/gemfiles/rails_5_0.gemfile +0 -22
  56. data/gemfiles/rails_5_1.gemfile +0 -22
  57. data/gemfiles/rails_5_2.gemfile +0 -18
  58. data/gemfiles/rails_6_0.gemfile +0 -22
  59. data/gemfiles/rails_master.gemfile +0 -22
  60. data/lib/apartment/reloader.rb +0 -21
  61. data/spec/adapters/jdbc_mysql_adapter_spec.rb +0 -19
  62. data/spec/adapters/jdbc_postgresql_adapter_spec.rb +0 -41
  63. data/spec/adapters/mysql2_adapter_spec.rb +0 -59
  64. data/spec/adapters/postgresql_adapter_spec.rb +0 -61
  65. data/spec/adapters/sqlite3_adapter_spec.rb +0 -83
  66. data/spec/apartment_spec.rb +0 -11
  67. data/spec/config/database.yml.sample +0 -49
  68. data/spec/dummy/Rakefile +0 -7
  69. data/spec/dummy/app/controllers/application_controller.rb +0 -6
  70. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  71. data/spec/dummy/app/models/company.rb +0 -3
  72. data/spec/dummy/app/models/user.rb +0 -3
  73. data/spec/dummy/app/views/application/index.html.erb +0 -1
  74. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  75. data/spec/dummy/config/application.rb +0 -49
  76. data/spec/dummy/config/boot.rb +0 -11
  77. data/spec/dummy/config/database.yml.sample +0 -44
  78. data/spec/dummy/config/environment.rb +0 -5
  79. data/spec/dummy/config/environments/development.rb +0 -28
  80. data/spec/dummy/config/environments/production.rb +0 -51
  81. data/spec/dummy/config/environments/test.rb +0 -34
  82. data/spec/dummy/config/initializers/apartment.rb +0 -4
  83. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  84. data/spec/dummy/config/initializers/inflections.rb +0 -10
  85. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  86. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  87. data/spec/dummy/config/initializers/session_store.rb +0 -8
  88. data/spec/dummy/config/locales/en.yml +0 -5
  89. data/spec/dummy/config/routes.rb +0 -3
  90. data/spec/dummy/config.ru +0 -4
  91. data/spec/dummy/db/migrate/20110613152810_create_dummy_models.rb +0 -39
  92. data/spec/dummy/db/migrate/20111202022214_create_table_books.rb +0 -14
  93. data/spec/dummy/db/migrate/20180415260934_create_public_tokens.rb +0 -13
  94. data/spec/dummy/db/schema.rb +0 -55
  95. data/spec/dummy/db/seeds/import.rb +0 -5
  96. data/spec/dummy/db/seeds.rb +0 -5
  97. data/spec/dummy/db/test.sqlite3 +0 -0
  98. data/spec/dummy/public/404.html +0 -26
  99. data/spec/dummy/public/422.html +0 -26
  100. data/spec/dummy/public/500.html +0 -26
  101. data/spec/dummy/public/favicon.ico +0 -0
  102. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  103. data/spec/dummy/script/rails +0 -6
  104. data/spec/dummy_engine/.gitignore +0 -8
  105. data/spec/dummy_engine/Gemfile +0 -15
  106. data/spec/dummy_engine/Rakefile +0 -34
  107. data/spec/dummy_engine/bin/rails +0 -12
  108. data/spec/dummy_engine/config/initializers/apartment.rb +0 -51
  109. data/spec/dummy_engine/dummy_engine.gemspec +0 -24
  110. data/spec/dummy_engine/lib/dummy_engine/engine.rb +0 -4
  111. data/spec/dummy_engine/lib/dummy_engine/version.rb +0 -3
  112. data/spec/dummy_engine/lib/dummy_engine.rb +0 -4
  113. data/spec/dummy_engine/test/dummy/Rakefile +0 -6
  114. data/spec/dummy_engine/test/dummy/config/application.rb +0 -22
  115. data/spec/dummy_engine/test/dummy/config/boot.rb +0 -5
  116. data/spec/dummy_engine/test/dummy/config/database.yml +0 -25
  117. data/spec/dummy_engine/test/dummy/config/environment.rb +0 -5
  118. data/spec/dummy_engine/test/dummy/config/environments/development.rb +0 -37
  119. data/spec/dummy_engine/test/dummy/config/environments/production.rb +0 -78
  120. data/spec/dummy_engine/test/dummy/config/environments/test.rb +0 -39
  121. data/spec/dummy_engine/test/dummy/config/initializers/assets.rb +0 -8
  122. data/spec/dummy_engine/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  123. data/spec/dummy_engine/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  124. data/spec/dummy_engine/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  125. data/spec/dummy_engine/test/dummy/config/initializers/inflections.rb +0 -16
  126. data/spec/dummy_engine/test/dummy/config/initializers/mime_types.rb +0 -4
  127. data/spec/dummy_engine/test/dummy/config/initializers/session_store.rb +0 -3
  128. data/spec/dummy_engine/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  129. data/spec/dummy_engine/test/dummy/config/locales/en.yml +0 -23
  130. data/spec/dummy_engine/test/dummy/config/routes.rb +0 -56
  131. data/spec/dummy_engine/test/dummy/config/secrets.yml +0 -22
  132. data/spec/dummy_engine/test/dummy/config.ru +0 -4
  133. data/spec/examples/connection_adapter_examples.rb +0 -42
  134. data/spec/examples/generic_adapter_custom_configuration_example.rb +0 -95
  135. data/spec/examples/generic_adapter_examples.rb +0 -163
  136. data/spec/examples/schema_adapter_examples.rb +0 -234
  137. data/spec/integration/apartment_rake_integration_spec.rb +0 -107
  138. data/spec/integration/query_caching_spec.rb +0 -81
  139. data/spec/integration/use_within_an_engine_spec.rb +0 -28
  140. data/spec/schemas/v1.rb +0 -16
  141. data/spec/schemas/v2.rb +0 -43
  142. data/spec/schemas/v3.rb +0 -49
  143. data/spec/spec_helper.rb +0 -61
  144. data/spec/support/apartment_helpers.rb +0 -43
  145. data/spec/support/capybara_sessions.rb +0 -15
  146. data/spec/support/config.rb +0 -10
  147. data/spec/support/contexts.rb +0 -52
  148. data/spec/support/requirements.rb +0 -35
  149. data/spec/support/setup.rb +0 -46
  150. data/spec/tasks/apartment_rake_spec.rb +0 -129
  151. data/spec/tenant_spec.rb +0 -190
  152. data/spec/unit/config_spec.rb +0 -112
  153. data/spec/unit/elevators/domain_spec.rb +0 -32
  154. data/spec/unit/elevators/first_subdomain_spec.rb +0 -24
  155. data/spec/unit/elevators/generic_spec.rb +0 -54
  156. data/spec/unit/elevators/host_hash_spec.rb +0 -32
  157. data/spec/unit/elevators/host_spec.rb +0 -89
  158. data/spec/unit/elevators/subdomain_spec.rb +0 -76
  159. data/spec/unit/migrator_spec.rb +0 -77
  160. data/spec/unit/reloader_spec.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e74c096e694174f974b93838c9aefec3722a87829cb10720ec8ff42cd8b279dc
4
- data.tar.gz: 0b65c080374f5162585da3d85fafecddb51c5fbe773aadf4f8210423d64fed81
3
+ metadata.gz: 2494257d1e615c2ef2e79647f3d5b62762dec8c51af19f2c5fe352b01572e752
4
+ data.tar.gz: 23b24db12c93d35cf10e34e1c71455a6fe05c9afe162dca6de5115212cb052b7
5
5
  SHA512:
6
- metadata.gz: 4644a38c447a86a7a1c759cc80bf99cfded7fef3527045696a24871698fc3e070b4252e18c9fef97a1ab57a6b15234bc6ed48aa177e041dad432b1b4498a8f3e
7
- data.tar.gz: bc2679a0ced346ad61aa12d06bec90b9b8a879855fa35a8ce195c05eb9ed4775f2204394062dea8913e214f666b47ccc7463512f010be580021ed1868549960f
6
+ metadata.gz: e13fe607631fe0953b16ec42a64ba162deb3fc1522b70ac09b152acbc47b6bebd63a25cc35a6873a3190304de40166f89e9782ceced0259932116739890526f2
7
+ data.tar.gz: 035b1b87cdf43f463a6895981d63100a238a2a8b3ad0e0b529d74fa261f6138005e0f5aecd425e857d9ba10ee11c613cb8d6b3002cd35484b34b58f4df367e9a
data/.pryrc CHANGED
@@ -1,3 +1,5 @@
1
- if defined?(Rails) && Rails.env
2
- extend Rails::ConsoleMethods
3
- end
1
+ # frozen_string_literal: true
2
+
3
+ # rubocop:disable Style/MixinUsage
4
+ extend Rails::ConsoleMethods if defined?(Rails) && Rails.env
5
+ # rubocop:enable Style/MixinUsage
data/.rubocop.yml ADDED
@@ -0,0 +1,36 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - rubocop-rails
5
+ - rubocop-performance
6
+ - rubocop-rspec
7
+
8
+ AllCops:
9
+ Exclude:
10
+ - vendor/bundle/**/*
11
+ - gemfiles/**/*.gemfile
12
+ - gemfiles/vendor/**/*
13
+ - spec/dummy_engine/dummy_engine.gemspec
14
+ - spec/schemas/**/*.rb
15
+
16
+ NewCops: enable
17
+
18
+ Gemspec/RequiredRubyVersion:
19
+ Exclude:
20
+ - 'ros-apartment.gemspec'
21
+
22
+ Metrics/BlockLength:
23
+ Exclude:
24
+ - spec/**/*.rb
25
+
26
+ Rails/RakeEnvironment:
27
+ Enabled: false
28
+
29
+ Rails/ApplicationRecord:
30
+ Enabled: false
31
+
32
+ Rails/Output:
33
+ Enabled: false
34
+
35
+ Style/Documentation:
36
+ Enabled: false
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,439 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2024-05-07 18:57:21 UTC using RuboCop version 1.63.4.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: Severity, Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/DeprecatedAttributeAssignment:
14
+ Exclude:
15
+ - 'ros-apartment.gemspec'
16
+
17
+ # Offense count: 20
18
+ # Configuration parameters: EnforcedStyle, AllowedGems, Include.
19
+ # SupportedStyles: Gemfile, gems.rb, gemspec
20
+ # Include: **/*.gemspec, **/Gemfile, **/gems.rb
21
+ Gemspec/DevelopmentDependencies:
22
+ Exclude:
23
+ - 'ros-apartment.gemspec'
24
+
25
+ # Offense count: 1
26
+ # This cop supports safe autocorrection (--autocorrect).
27
+ # Configuration parameters: Severity, Include.
28
+ # Include: **/*.gemspec
29
+ Gemspec/RequireMFA:
30
+ Exclude:
31
+ - 'ros-apartment.gemspec'
32
+
33
+ # Offense count: 6
34
+ # This cop supports safe autocorrection (--autocorrect).
35
+ Layout/EmptyLineAfterMagicComment:
36
+ Exclude:
37
+ - 'spec/dummy/config/initializers/backtrace_silencers.rb'
38
+ - 'spec/dummy/config/initializers/inflections.rb'
39
+ - 'spec/dummy/config/initializers/mime_types.rb'
40
+ - 'spec/dummy_engine/test/dummy/config/initializers/backtrace_silencers.rb'
41
+ - 'spec/dummy_engine/test/dummy/config/initializers/inflections.rb'
42
+ - 'spec/dummy_engine/test/dummy/config/initializers/mime_types.rb'
43
+
44
+ # Offense count: 3
45
+ # This cop supports safe autocorrection (--autocorrect).
46
+ # Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
47
+ Layout/LeadingCommentSpace:
48
+ Exclude:
49
+ - 'ros-apartment.gemspec'
50
+
51
+ # Offense count: 2
52
+ # This cop supports safe autocorrection (--autocorrect).
53
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
54
+ # SupportedStyles: aligned, indented
55
+ Layout/LineEndStringConcatenationIndentation:
56
+ Exclude:
57
+ - 'lib/apartment/custom_console.rb'
58
+
59
+ # Offense count: 3
60
+ # This cop supports safe autocorrection (--autocorrect).
61
+ Layout/SpaceBeforeComment:
62
+ Exclude:
63
+ - 'ros-apartment.gemspec'
64
+
65
+ # Offense count: 1
66
+ Lint/MixedRegexpCaptureTypes:
67
+ Exclude:
68
+ - 'lib/apartment/elevators/domain.rb'
69
+
70
+ # Offense count: 1
71
+ # This cop supports safe autocorrection (--autocorrect).
72
+ Lint/RedundantCopDisableDirective:
73
+ Exclude:
74
+ - 'spec/support/config.rb'
75
+
76
+ # Offense count: 2
77
+ # This cop supports unsafe autocorrection (--autocorrect-all).
78
+ Lint/RedundantDirGlobSort:
79
+ Exclude:
80
+ - 'spec/spec_helper.rb'
81
+
82
+ # Offense count: 2
83
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
84
+ Metrics/AbcSize:
85
+ Max: 28
86
+
87
+ # Offense count: 4
88
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
89
+ # AllowedMethods: refine
90
+ Metrics/BlockLength:
91
+ Max: 83
92
+
93
+ # Offense count: 1
94
+ # Configuration parameters: CountComments, CountAsOne.
95
+ Metrics/ClassLength:
96
+ Max: 151
97
+
98
+ # Offense count: 6
99
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
100
+ Metrics/MethodLength:
101
+ Max: 23
102
+
103
+ # Offense count: 3
104
+ # This cop supports safe autocorrection (--autocorrect).
105
+ # Configuration parameters: EnforcedStyle, BlockForwardingName.
106
+ # SupportedStyles: anonymous, explicit
107
+ Naming/BlockForwarding:
108
+ Exclude:
109
+ - 'lib/apartment/adapters/abstract_adapter.rb'
110
+ - 'lib/apartment/log_subscriber.rb'
111
+
112
+ # Offense count: 1
113
+ # This cop supports safe autocorrection (--autocorrect).
114
+ Performance/RedundantBlockCall:
115
+ Exclude:
116
+ - 'lib/apartment/tasks/task_helper.rb'
117
+
118
+ # Offense count: 1
119
+ # This cop supports safe autocorrection (--autocorrect).
120
+ Performance/StringIdentifierArgument:
121
+ Exclude:
122
+ - 'lib/apartment/railtie.rb'
123
+
124
+ # Offense count: 3
125
+ RSpec/AnyInstance:
126
+ Exclude:
127
+ - 'spec/unit/migrator_spec.rb'
128
+
129
+ # Offense count: 4
130
+ # This cop supports unsafe autocorrection (--autocorrect-all).
131
+ RSpec/BeEq:
132
+ Exclude:
133
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
134
+ - 'spec/unit/elevators/first_subdomain_spec.rb'
135
+
136
+ # Offense count: 2
137
+ RSpec/BeforeAfterAll:
138
+ Exclude:
139
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
140
+ - 'spec/tasks/apartment_rake_spec.rb'
141
+
142
+ # Offense count: 18
143
+ # Configuration parameters: Prefixes, AllowedPatterns.
144
+ # Prefixes: when, with, without
145
+ RSpec/ContextWording:
146
+ Exclude:
147
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
148
+ - 'spec/examples/generic_adapter_custom_configuration_example.rb'
149
+ - 'spec/examples/schema_adapter_examples.rb'
150
+ - 'spec/support/contexts.rb'
151
+ - 'spec/tasks/apartment_rake_spec.rb'
152
+ - 'spec/tenant_spec.rb'
153
+
154
+ # Offense count: 5
155
+ # Configuration parameters: IgnoredMetadata.
156
+ RSpec/DescribeClass:
157
+ Exclude:
158
+ - 'spec/integration/apartment_rake_integration_spec.rb'
159
+ - 'spec/integration/connection_handling_spec.rb'
160
+ - 'spec/integration/query_caching_spec.rb'
161
+ - 'spec/integration/use_within_an_engine_spec.rb'
162
+ - 'spec/tasks/apartment_rake_spec.rb'
163
+
164
+ # Offense count: 6
165
+ # This cop supports unsafe autocorrection (--autocorrect-all).
166
+ # Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
167
+ # SupportedStyles: described_class, explicit
168
+ RSpec/DescribedClass:
169
+ Exclude:
170
+ - 'spec/apartment_spec.rb'
171
+ - 'spec/tenant_spec.rb'
172
+ - 'spec/unit/elevators/host_hash_spec.rb'
173
+ - 'spec/unit/migrator_spec.rb'
174
+
175
+ # Offense count: 5
176
+ # This cop supports safe autocorrection (--autocorrect).
177
+ RSpec/EmptyLineAfterFinalLet:
178
+ Exclude:
179
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
180
+ - 'spec/examples/schema_adapter_examples.rb'
181
+
182
+ # Offense count: 14
183
+ # Configuration parameters: CountAsOne.
184
+ RSpec/ExampleLength:
185
+ Max: 12
186
+
187
+ # Offense count: 58
188
+ # This cop supports safe autocorrection (--autocorrect).
189
+ # Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
190
+ # DisallowedExamples: works
191
+ RSpec/ExampleWording:
192
+ Exclude:
193
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
194
+ - 'spec/apartment_spec.rb'
195
+ - 'spec/examples/connection_adapter_examples.rb'
196
+ - 'spec/examples/generic_adapter_custom_configuration_example.rb'
197
+ - 'spec/examples/generic_adapter_examples.rb'
198
+ - 'spec/examples/schema_adapter_examples.rb'
199
+ - 'spec/integration/apartment_rake_integration_spec.rb'
200
+ - 'spec/integration/use_within_an_engine_spec.rb'
201
+ - 'spec/tasks/apartment_rake_spec.rb'
202
+ - 'spec/tenant_spec.rb'
203
+
204
+ # Offense count: 12
205
+ # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
206
+ # Include: **/*_spec*rb*, **/spec/**/*
207
+ RSpec/FilePath:
208
+ Exclude:
209
+ - 'spec/adapters/mysql2_adapter_spec.rb'
210
+ - 'spec/adapters/trilogy_adapter_spec.rb'
211
+ - 'spec/adapters/postgresql_adapter_spec.rb'
212
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
213
+ - 'spec/tenant_spec.rb'
214
+ - 'spec/unit/config_spec.rb'
215
+ - 'spec/unit/elevators/domain_spec.rb'
216
+ - 'spec/unit/elevators/first_subdomain_spec.rb'
217
+ - 'spec/unit/elevators/generic_spec.rb'
218
+ - 'spec/unit/elevators/host_hash_spec.rb'
219
+ - 'spec/unit/elevators/host_spec.rb'
220
+ - 'spec/unit/elevators/subdomain_spec.rb'
221
+ - 'spec/unit/migrator_spec.rb'
222
+
223
+ # Offense count: 1
224
+ # This cop supports safe autocorrection (--autocorrect).
225
+ # Configuration parameters: EnforcedStyle.
226
+ # SupportedStyles: implicit, each, example
227
+ RSpec/HookArgument:
228
+ Exclude:
229
+ - 'spec/support/setup.rb'
230
+
231
+ # Offense count: 4
232
+ # This cop supports safe autocorrection (--autocorrect).
233
+ RSpec/HooksBeforeExamples:
234
+ Exclude:
235
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
236
+ - 'spec/examples/schema_adapter_examples.rb'
237
+
238
+ # Offense count: 4
239
+ # Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
240
+ RSpec/IndexedLet:
241
+ Exclude:
242
+ - 'spec/examples/schema_adapter_examples.rb'
243
+ - 'spec/support/contexts.rb'
244
+
245
+ # Offense count: 16
246
+ # Configuration parameters: AssignmentOnly.
247
+ RSpec/InstanceVariable:
248
+ Exclude:
249
+ - 'spec/examples/generic_adapter_examples.rb'
250
+ - 'spec/examples/schema_adapter_examples.rb'
251
+ - 'spec/integration/apartment_rake_integration_spec.rb'
252
+ - 'spec/integration/use_within_an_engine_spec.rb'
253
+ - 'spec/tasks/apartment_rake_spec.rb'
254
+
255
+ # Offense count: 2
256
+ RSpec/LeakyConstantDeclaration:
257
+ Exclude:
258
+ - 'spec/examples/generic_adapters_callbacks_examples.rb'
259
+ - 'spec/unit/elevators/generic_spec.rb'
260
+
261
+ # Offense count: 27
262
+ # Configuration parameters: EnforcedStyle.
263
+ # SupportedStyles: have_received, receive
264
+ RSpec/MessageSpies:
265
+ Exclude:
266
+ - 'spec/examples/generic_adapter_custom_configuration_example.rb'
267
+ - 'spec/integration/apartment_rake_integration_spec.rb'
268
+ - 'spec/integration/use_within_an_engine_spec.rb'
269
+ - 'spec/tasks/apartment_rake_spec.rb'
270
+ - 'spec/unit/elevators/domain_spec.rb'
271
+ - 'spec/unit/elevators/generic_spec.rb'
272
+ - 'spec/unit/elevators/host_hash_spec.rb'
273
+ - 'spec/unit/elevators/host_spec.rb'
274
+ - 'spec/unit/elevators/subdomain_spec.rb'
275
+ - 'spec/unit/migrator_spec.rb'
276
+
277
+ # Offense count: 11
278
+ # This cop supports safe autocorrection (--autocorrect).
279
+ # Configuration parameters: EnforcedStyle.
280
+ # SupportedStyles: hash, symbol
281
+ RSpec/MetadataStyle:
282
+ Exclude:
283
+ - 'spec/examples/schema_adapter_examples.rb'
284
+ - 'spec/support/contexts.rb'
285
+
286
+ # Offense count: 27
287
+ RSpec/MultipleExpectations:
288
+ Max: 6
289
+
290
+ # Offense count: 46
291
+ # Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
292
+ # SupportedStyles: always, named_only
293
+ RSpec/NamedSubject:
294
+ Exclude:
295
+ - 'spec/adapters/mysql2_adapter_spec.rb'
296
+ - 'spec/adapters/trilogy_adapter_spec.rb'
297
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
298
+ - 'spec/support/contexts.rb'
299
+ - 'spec/support/requirements.rb'
300
+ - 'spec/tenant_spec.rb'
301
+
302
+ # Offense count: 22
303
+ # Configuration parameters: AllowedGroups.
304
+ RSpec/NestedGroups:
305
+ Max: 5
306
+
307
+ # Offense count: 1
308
+ # Configuration parameters: AllowedPatterns.
309
+ # AllowedPatterns: ^expect_, ^assert_
310
+ RSpec/NoExpectationExample:
311
+ Exclude:
312
+ - 'spec/tenant_spec.rb'
313
+
314
+ # Offense count: 12
315
+ # Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
316
+ # Include: **/*_spec.rb
317
+ RSpec/SpecFilePathFormat:
318
+ Exclude:
319
+ - 'spec/adapters/mysql2_adapter_spec.rb'
320
+ - 'spec/adapters/trilogy_adapter_spec.rb'
321
+ - 'spec/adapters/postgresql_adapter_spec.rb'
322
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
323
+ - 'spec/tenant_spec.rb'
324
+ - 'spec/unit/config_spec.rb'
325
+ - 'spec/unit/elevators/domain_spec.rb'
326
+ - 'spec/unit/elevators/first_subdomain_spec.rb'
327
+ - 'spec/unit/elevators/generic_spec.rb'
328
+ - 'spec/unit/elevators/host_hash_spec.rb'
329
+ - 'spec/unit/elevators/host_spec.rb'
330
+ - 'spec/unit/elevators/subdomain_spec.rb'
331
+ - 'spec/unit/migrator_spec.rb'
332
+
333
+ # Offense count: 2
334
+ # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
335
+ RSpec/VerifiedDoubles:
336
+ Exclude:
337
+ - 'spec/integration/apartment_rake_integration_spec.rb'
338
+ - 'spec/unit/elevators/first_subdomain_spec.rb'
339
+
340
+ # Offense count: 2
341
+ # This cop supports safe autocorrection (--autocorrect).
342
+ Rails/IndexWith:
343
+ Exclude:
344
+ - 'lib/apartment.rb'
345
+ - 'spec/unit/config_spec.rb'
346
+
347
+ # Offense count: 7
348
+ # This cop supports unsafe autocorrection (--autocorrect-all).
349
+ Rails/Pluck:
350
+ Exclude:
351
+ - 'spec/adapters/jdbc_mysql_adapter_spec.rb'
352
+ - 'spec/adapters/jdbc_postgresql_adapter_spec.rb'
353
+ - 'spec/adapters/mysql2_adapter_spec.rb'
354
+ - 'spec/adapters/postgresql_adapter_spec.rb'
355
+
356
+ # Offense count: 1
357
+ # This cop supports unsafe autocorrection (--autocorrect-all).
358
+ Security/IoMethods:
359
+ Exclude:
360
+ - 'spec/support/config.rb'
361
+
362
+ # Offense count: 16
363
+ # Configuration parameters: AllowedConstants.
364
+ Style/Documentation:
365
+ Exclude:
366
+ - 'lib/apartment/adapters/jdbc_mysql_adapter.rb'
367
+ - 'lib/apartment/adapters/postgis_adapter.rb'
368
+ - 'lib/apartment/adapters/postgresql_adapter.rb'
369
+ - 'lib/apartment/adapters/sqlite3_adapter.rb'
370
+ - 'lib/apartment/custom_console.rb'
371
+ - 'lib/apartment/deprecation.rb'
372
+ - 'lib/apartment/migrator.rb'
373
+ - 'lib/apartment/model.rb'
374
+ - 'lib/apartment/railtie.rb'
375
+ - 'lib/apartment/tasks/enhancements.rb'
376
+ - 'lib/apartment/tasks/task_helper.rb'
377
+ - 'lib/generators/apartment/install/install_generator.rb'
378
+
379
+ # Offense count: 4
380
+ # This cop supports safe autocorrection (--autocorrect).
381
+ # Configuration parameters: AllowedVars.
382
+ Style/FetchEnvVar:
383
+ Exclude:
384
+ - 'lib/apartment/adapters/postgresql_adapter.rb'
385
+
386
+ # Offense count: 3
387
+ # This cop supports safe autocorrection (--autocorrect).
388
+ # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
389
+ # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
390
+ # SupportedShorthandSyntax: always, never, either, consistent
391
+ Style/HashSyntax:
392
+ Exclude:
393
+ - 'lib/apartment/active_record/connection_handling.rb'
394
+ - 'spec/integration/connection_handling_spec.rb'
395
+
396
+ # Offense count: 1
397
+ # This cop supports unsafe autocorrection (--autocorrect-all).
398
+ # Configuration parameters: EnforcedStyle, Autocorrect.
399
+ # SupportedStyles: module_function, extend_self, forbidden
400
+ Style/ModuleFunction:
401
+ Exclude:
402
+ - 'lib/apartment/migrator.rb'
403
+
404
+ # Offense count: 4
405
+ # This cop supports safe autocorrection (--autocorrect).
406
+ Style/RedundantConstantBase:
407
+ Exclude:
408
+ - 'spec/apartment_spec.rb'
409
+ - 'spec/dummy/config.ru'
410
+ - 'spec/dummy_engine/test/dummy/config.ru'
411
+ - 'spec/dummy_engine/test/dummy/config/environments/production.rb'
412
+
413
+ # Offense count: 1
414
+ # This cop supports safe autocorrection (--autocorrect).
415
+ Style/RedundantParentheses:
416
+ Exclude:
417
+ - 'lib/apartment.rb'
418
+
419
+ # Offense count: 1
420
+ # This cop supports safe autocorrection (--autocorrect).
421
+ Style/RedundantRegexpArgument:
422
+ Exclude:
423
+ - 'lib/apartment/tasks/enhancements.rb'
424
+
425
+ # Offense count: 3
426
+ # This cop supports unsafe autocorrection (--autocorrect-all).
427
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
428
+ # AllowedMethods: present?, blank?, presence, try, try!
429
+ Style/SafeNavigation:
430
+ Exclude:
431
+ - 'lib/apartment/migrator.rb'
432
+ - 'lib/tasks/apartment.rake'
433
+
434
+ # Offense count: 2
435
+ # This cop supports safe autocorrection (--autocorrect).
436
+ Style/SuperWithArgsParentheses:
437
+ Exclude:
438
+ - 'lib/apartment/adapters/sqlite3_adapter.rb'
439
+ - 'lib/apartment/elevators/host_hash.rb'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.3.1
data/Appraisals CHANGED
@@ -1,71 +1,50 @@
1
- appraise "rails-4-2" do
2
- gem "rails", "~> 4.2.0"
3
- platforms :ruby do
4
- gem "pg", "< 1.0.0"
5
- gem "mysql2", "~> 0.4.0"
6
- end
7
- platforms :jruby do
8
- gem 'activerecord-jdbc-adapter', '~> 1.3'
9
- gem 'activerecord-jdbcpostgresql-adapter', '~> 1.3'
10
- gem 'activerecord-jdbcmysql-adapter', '~> 1.3'
11
- end
12
- end
13
-
14
- appraise "rails-5-0" do
15
- gem "rails", "~> 5.0.0"
16
- platforms :ruby do
17
- gem "pg", "< 1.0.0"
18
- end
19
- platforms :jruby do
20
- gem 'activerecord-jdbc-adapter', '~> 50.0'
21
- gem 'activerecord-jdbcpostgresql-adapter', '~> 50.0'
22
- gem 'activerecord-jdbcmysql-adapter', '~> 50.0'
23
- end
24
- end
1
+ # frozen_string_literal: true
25
2
 
26
- appraise "rails-5-1" do
27
- gem "rails", "~> 5.1.0"
3
+ appraise 'rails-6-1' do
4
+ gem 'rails', '~> 6.1.0'
28
5
  platforms :ruby do
29
- gem "pg", "< 1.0.0"
30
- end
31
- platforms :jruby do
32
- gem 'activerecord-jdbc-adapter', '~> 51.0'
33
- gem 'activerecord-jdbcpostgresql-adapter', '~> 51.0'
34
- gem 'activerecord-jdbcmysql-adapter', '~> 51.0'
6
+ gem 'sqlite3', '~> 1.4'
35
7
  end
36
- end
37
-
38
- appraise "rails-5-2" do
39
- gem "rails", "~> 5.2.0"
40
8
  platforms :jruby do
41
- gem 'activerecord-jdbc-adapter', '~> 52.0'
42
- gem 'activerecord-jdbcpostgresql-adapter', '~> 52.0'
43
- gem 'activerecord-jdbcmysql-adapter', '~> 52.0'
9
+ gem 'activerecord-jdbc-adapter', '~> 61.0'
10
+ gem 'activerecord-jdbcpostgresql-adapter', '~> 61.0'
11
+ gem 'activerecord-jdbcmysql-adapter', '~> 61.0'
44
12
  end
45
13
  end
46
14
 
47
-
48
- appraise "rails-6-0" do
49
- gem "rails", "~> 6.0.0.rc1"
15
+ appraise 'rails-7-0' do
16
+ gem 'rails', '~> 7.0.0'
50
17
  platforms :ruby do
51
18
  gem 'sqlite3', '~> 1.4'
52
19
  end
53
20
  platforms :jruby do
54
- gem 'activerecord-jdbc-adapter', '~> 60.0.rc1'
55
- gem 'activerecord-jdbcpostgresql-adapter', '~> 60.0.rc1'
56
- gem 'activerecord-jdbcmysql-adapter', '~> 60.0.rc1'
21
+ gem 'activerecord-jdbc-adapter', '~> 70.0'
22
+ gem 'activerecord-jdbcpostgresql-adapter', '~> 70.0'
23
+ gem 'activerecord-jdbcmysql-adapter', '~> 70.0'
57
24
  end
58
25
  end
59
26
 
60
-
61
- appraise "rails-master" do
62
- gem "rails", git: 'https://github.com/rails/rails.git'
27
+ appraise 'rails-7-1' do
28
+ gem 'rails', '~> 7.1.0'
63
29
  platforms :ruby do
64
- gem 'sqlite3', '~> 1.4'
30
+ gem 'sqlite3', '~> 1.6'
65
31
  end
66
32
  platforms :jruby do
67
- gem 'activerecord-jdbc-adapter', '~> 52.0'
68
- gem 'activerecord-jdbcpostgresql-adapter', '~> 52.0'
69
- gem 'activerecord-jdbcmysql-adapter', '~> 52.0'
33
+ gem 'activerecord-jdbc-adapter', '~> 71.0'
34
+ gem 'activerecord-jdbcpostgresql-adapter', '~> 71.0'
35
+ gem 'activerecord-jdbcmysql-adapter', '~> 71.0'
70
36
  end
71
37
  end
38
+
39
+ # Install Rails from the main branch are failing
40
+ # appraise 'rails-master' do
41
+ # gem 'rails', git: 'https://github.com/rails/rails.git'
42
+ # platforms :ruby do
43
+ # gem 'sqlite3', '~> 2.0'
44
+ # end
45
+ # platforms :jruby do
46
+ # gem 'activerecord-jdbc-adapter', '~> 61.0'
47
+ # gem 'activerecord-jdbcpostgresql-adapter', '~> 61.0'
48
+ # gem 'activerecord-jdbcmysql-adapter', '~> 61.0'
49
+ # end
50
+ # end