ros-apartment 2.3.0 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +78 -0
  3. data/.github/workflows/changelog.yml +63 -0
  4. data/.github/workflows/reviewdog.yml +22 -0
  5. data/.pryrc +5 -3
  6. data/.rubocop.yml +32 -0
  7. data/.rubocop_todo.yml +233 -0
  8. data/.ruby-version +1 -0
  9. data/.story_branch.yml +5 -0
  10. data/Appraisals +29 -42
  11. data/CHANGELOG.md +963 -0
  12. data/Gemfile +2 -7
  13. data/Guardfile +3 -16
  14. data/HISTORY.md +159 -68
  15. data/README.md +101 -21
  16. data/Rakefile +39 -22
  17. data/TODO.md +0 -1
  18. data/gemfiles/rails_5_2.gemfile +0 -5
  19. data/gemfiles/rails_6_0.gemfile +4 -9
  20. data/gemfiles/rails_6_1.gemfile +17 -0
  21. data/gemfiles/rails_7_0.gemfile +17 -0
  22. data/gemfiles/rails_master.gemfile +3 -8
  23. data/lib/apartment/active_record/connection_handling.rb +20 -0
  24. data/lib/apartment/active_record/internal_metadata.rb +9 -0
  25. data/lib/apartment/active_record/postgresql_adapter.rb +39 -0
  26. data/lib/apartment/active_record/schema_migration.rb +11 -0
  27. data/lib/apartment/adapters/abstract_adapter.rb +52 -46
  28. data/lib/apartment/adapters/abstract_jdbc_adapter.rb +5 -3
  29. data/lib/apartment/adapters/jdbc_mysql_adapter.rb +3 -3
  30. data/lib/apartment/adapters/jdbc_postgresql_adapter.rb +19 -13
  31. data/lib/apartment/adapters/mysql2_adapter.rb +15 -9
  32. data/lib/apartment/adapters/postgis_adapter.rb +3 -2
  33. data/lib/apartment/adapters/postgresql_adapter.rb +79 -31
  34. data/lib/apartment/adapters/sqlite3_adapter.rb +18 -8
  35. data/lib/apartment/console.rb +23 -11
  36. data/lib/apartment/custom_console.rb +42 -0
  37. data/lib/apartment/deprecation.rb +2 -1
  38. data/lib/apartment/elevators/domain.rb +4 -3
  39. data/lib/apartment/elevators/first_subdomain.rb +3 -2
  40. data/lib/apartment/elevators/generic.rb +4 -3
  41. data/lib/apartment/elevators/host.rb +6 -1
  42. data/lib/apartment/elevators/host_hash.rb +6 -2
  43. data/lib/apartment/elevators/subdomain.rb +9 -5
  44. data/lib/apartment/log_subscriber.rb +33 -0
  45. data/lib/apartment/migrator.rb +4 -3
  46. data/lib/apartment/model.rb +29 -0
  47. data/lib/apartment/railtie.rb +16 -20
  48. data/lib/apartment/tasks/enhancements.rb +4 -6
  49. data/lib/apartment/tasks/task_helper.rb +52 -0
  50. data/lib/apartment/tenant.rb +7 -10
  51. data/lib/apartment/version.rb +3 -1
  52. data/lib/apartment.rb +56 -15
  53. data/lib/generators/apartment/install/install_generator.rb +4 -3
  54. data/lib/generators/apartment/install/templates/apartment.rb +10 -3
  55. data/lib/tasks/apartment.rake +48 -87
  56. data/ros-apartment.gemspec +59 -0
  57. metadata +148 -240
  58. data/.travis.yml +0 -65
  59. data/apartment.gemspec +0 -47
  60. data/gemfiles/rails_4_2.gemfile +0 -23
  61. data/gemfiles/rails_5_0.gemfile +0 -22
  62. data/gemfiles/rails_5_1.gemfile +0 -22
  63. data/lib/apartment/reloader.rb +0 -21
  64. data/spec/adapters/jdbc_mysql_adapter_spec.rb +0 -19
  65. data/spec/adapters/jdbc_postgresql_adapter_spec.rb +0 -41
  66. data/spec/adapters/mysql2_adapter_spec.rb +0 -59
  67. data/spec/adapters/postgresql_adapter_spec.rb +0 -61
  68. data/spec/adapters/sqlite3_adapter_spec.rb +0 -83
  69. data/spec/apartment_spec.rb +0 -11
  70. data/spec/config/database.yml.sample +0 -49
  71. data/spec/dummy/Rakefile +0 -7
  72. data/spec/dummy/app/controllers/application_controller.rb +0 -6
  73. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  74. data/spec/dummy/app/models/company.rb +0 -3
  75. data/spec/dummy/app/models/user.rb +0 -3
  76. data/spec/dummy/app/views/application/index.html.erb +0 -1
  77. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  78. data/spec/dummy/config/application.rb +0 -49
  79. data/spec/dummy/config/boot.rb +0 -11
  80. data/spec/dummy/config/database.yml.sample +0 -44
  81. data/spec/dummy/config/environment.rb +0 -5
  82. data/spec/dummy/config/environments/development.rb +0 -28
  83. data/spec/dummy/config/environments/production.rb +0 -51
  84. data/spec/dummy/config/environments/test.rb +0 -34
  85. data/spec/dummy/config/initializers/apartment.rb +0 -4
  86. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  87. data/spec/dummy/config/initializers/inflections.rb +0 -10
  88. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  89. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  90. data/spec/dummy/config/initializers/session_store.rb +0 -8
  91. data/spec/dummy/config/locales/en.yml +0 -5
  92. data/spec/dummy/config/routes.rb +0 -3
  93. data/spec/dummy/config.ru +0 -4
  94. data/spec/dummy/db/migrate/20110613152810_create_dummy_models.rb +0 -39
  95. data/spec/dummy/db/migrate/20111202022214_create_table_books.rb +0 -14
  96. data/spec/dummy/db/migrate/20180415260934_create_public_tokens.rb +0 -13
  97. data/spec/dummy/db/schema.rb +0 -55
  98. data/spec/dummy/db/seeds/import.rb +0 -5
  99. data/spec/dummy/db/seeds.rb +0 -5
  100. data/spec/dummy/db/test.sqlite3 +0 -0
  101. data/spec/dummy/public/404.html +0 -26
  102. data/spec/dummy/public/422.html +0 -26
  103. data/spec/dummy/public/500.html +0 -26
  104. data/spec/dummy/public/favicon.ico +0 -0
  105. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  106. data/spec/dummy/script/rails +0 -6
  107. data/spec/dummy_engine/.gitignore +0 -8
  108. data/spec/dummy_engine/Gemfile +0 -15
  109. data/spec/dummy_engine/Rakefile +0 -34
  110. data/spec/dummy_engine/bin/rails +0 -12
  111. data/spec/dummy_engine/config/initializers/apartment.rb +0 -51
  112. data/spec/dummy_engine/dummy_engine.gemspec +0 -24
  113. data/spec/dummy_engine/lib/dummy_engine/engine.rb +0 -4
  114. data/spec/dummy_engine/lib/dummy_engine/version.rb +0 -3
  115. data/spec/dummy_engine/lib/dummy_engine.rb +0 -4
  116. data/spec/dummy_engine/test/dummy/Rakefile +0 -6
  117. data/spec/dummy_engine/test/dummy/config/application.rb +0 -22
  118. data/spec/dummy_engine/test/dummy/config/boot.rb +0 -5
  119. data/spec/dummy_engine/test/dummy/config/database.yml +0 -25
  120. data/spec/dummy_engine/test/dummy/config/environment.rb +0 -5
  121. data/spec/dummy_engine/test/dummy/config/environments/development.rb +0 -37
  122. data/spec/dummy_engine/test/dummy/config/environments/production.rb +0 -78
  123. data/spec/dummy_engine/test/dummy/config/environments/test.rb +0 -39
  124. data/spec/dummy_engine/test/dummy/config/initializers/assets.rb +0 -8
  125. data/spec/dummy_engine/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  126. data/spec/dummy_engine/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  127. data/spec/dummy_engine/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  128. data/spec/dummy_engine/test/dummy/config/initializers/inflections.rb +0 -16
  129. data/spec/dummy_engine/test/dummy/config/initializers/mime_types.rb +0 -4
  130. data/spec/dummy_engine/test/dummy/config/initializers/session_store.rb +0 -3
  131. data/spec/dummy_engine/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  132. data/spec/dummy_engine/test/dummy/config/locales/en.yml +0 -23
  133. data/spec/dummy_engine/test/dummy/config/routes.rb +0 -56
  134. data/spec/dummy_engine/test/dummy/config/secrets.yml +0 -22
  135. data/spec/dummy_engine/test/dummy/config.ru +0 -4
  136. data/spec/examples/connection_adapter_examples.rb +0 -42
  137. data/spec/examples/generic_adapter_custom_configuration_example.rb +0 -95
  138. data/spec/examples/generic_adapter_examples.rb +0 -163
  139. data/spec/examples/schema_adapter_examples.rb +0 -234
  140. data/spec/integration/apartment_rake_integration_spec.rb +0 -107
  141. data/spec/integration/query_caching_spec.rb +0 -81
  142. data/spec/integration/use_within_an_engine_spec.rb +0 -28
  143. data/spec/schemas/v1.rb +0 -16
  144. data/spec/schemas/v2.rb +0 -43
  145. data/spec/schemas/v3.rb +0 -49
  146. data/spec/spec_helper.rb +0 -61
  147. data/spec/support/apartment_helpers.rb +0 -43
  148. data/spec/support/capybara_sessions.rb +0 -15
  149. data/spec/support/config.rb +0 -10
  150. data/spec/support/contexts.rb +0 -52
  151. data/spec/support/requirements.rb +0 -35
  152. data/spec/support/setup.rb +0 -46
  153. data/spec/tasks/apartment_rake_spec.rb +0 -129
  154. data/spec/tenant_spec.rb +0 -190
  155. data/spec/unit/config_spec.rb +0 -112
  156. data/spec/unit/elevators/domain_spec.rb +0 -32
  157. data/spec/unit/elevators/first_subdomain_spec.rb +0 -24
  158. data/spec/unit/elevators/generic_spec.rb +0 -54
  159. data/spec/unit/elevators/host_hash_spec.rb +0 -32
  160. data/spec/unit/elevators/host_spec.rb +0 -89
  161. data/spec/unit/elevators/subdomain_spec.rb +0 -76
  162. data/spec/unit/migrator_spec.rb +0 -77
  163. data/spec/unit/reloader_spec.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea7b5564bca9125cfb7b8a7863793c69a3462dabd8211d274891b79a948c28f5
4
- data.tar.gz: c502a0c3dccdd4edca005b68b6e945d82a6943716d917ef2df2e6fa91d2a2204
3
+ metadata.gz: 6182f5dcd4e369e6f497295705079b3d0b20d644d8006c5a256d8618eff1a2c3
4
+ data.tar.gz: 351be335f73230dd83df3020ba77b33f8e33e297f67c5256210f3e0c0c12e749
5
5
  SHA512:
6
- metadata.gz: c1babac9d50b907b36337157870ab606291a91cb022a80b11a1e3f008301f2a1b019137fb8ea03119e2a054b97041d4e532191142fff97eee3ad27cc30b10a0c
7
- data.tar.gz: 7cee77bbe095d7f2d8b3a64468b5730d719152d5ec904ab15261b49366bc113dbb97f7b4a1297535c4c294d8b8099090f542ae315a2744fe55d1fb19895b4615
6
+ metadata.gz: 7714a5182a47cefc6a95d85118278263bf4d326c5441184005a3ef48cf10368cd123602a0e5635547233c12ecb587e107dc72c0a117423dd774054f19767e3ce
7
+ data.tar.gz: 6b4247215b4754d031ce248f6e457d1c509157d310964e74cc72f05e8f896215b29341cd892515c9e9803a2f0db6528f180474b0c14cf03384ee1ac4f9693164
@@ -0,0 +1,78 @@
1
+ version: 2.1
2
+
3
+ jobs:
4
+ build:
5
+ docker:
6
+ - image: circleci/<< parameters.ruby_version >>
7
+ - image: circleci/postgres:9.6.2-alpine
8
+ - image: circleci/mysql:5.7
9
+ environment:
10
+ MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
11
+ parameters:
12
+ ruby_version:
13
+ type: string
14
+ gemfile:
15
+ type: string
16
+ environment:
17
+ BUNDLE_GEMFILE: << parameters.gemfile >>
18
+ steps:
19
+ - checkout
20
+ # Restore Cached Dependencies
21
+ # - restore_cache:
22
+ # keys:
23
+ # - gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "<< parameters.gemfile >>.lock" }}
24
+ # - gem-cache-v1-{{ arch }}-{{ .Branch }}
25
+ # - gem-cache-v1
26
+
27
+ - run: bundle install --path vendor/bundle
28
+
29
+ # - save_cache:
30
+ # key: gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "<< parameters.gemfile >>.lock" }}
31
+ # paths:
32
+ # - vendor/bundle
33
+
34
+ - run:
35
+ name: Install postgres client
36
+ command: sudo apt install -y postgresql-client
37
+
38
+ - run:
39
+ name: Install mysql client
40
+ command: sudo apt install -y default-mysql-client
41
+
42
+ - run:
43
+ name: Configure config database.yml
44
+ command: bundle exec rake db:copy_credentials
45
+
46
+ - run:
47
+ name: wait for postgresql
48
+ command: dockerize -wait tcp://localhost:5432 -timeout 1m
49
+
50
+ - run:
51
+ name: wait for mysql
52
+ command: dockerize -wait tcp://localhost:3306 -timeout 1m
53
+
54
+ - run:
55
+ name: Database Setup
56
+ command: |
57
+ bundle exec rake db:test:prepare
58
+
59
+ - run:
60
+ name: Run tests
61
+ command: bundle exec rspec --format progress --format RspecJunitFormatter -o ~/test-results/rspec/rspec.xml
62
+
63
+ - store_test_results:
64
+ path: ~/test-results/rspec/
65
+
66
+ workflows:
67
+ tests:
68
+ jobs:
69
+ - build:
70
+ matrix:
71
+ parameters:
72
+ ruby_version: ["ruby:2.6-buster", "ruby:2.7-buster", "ruby:3.0-buster"]
73
+ gemfile: ["gemfiles/rails_5_2.gemfile", "gemfiles/rails_6_0.gemfile", "gemfiles/rails_6_1.gemfile", "gemfiles/rails_7_0.gemfile"]
74
+ exclude:
75
+ - ruby_version: "ruby:3.0-buster"
76
+ gemfile: "gemfiles/rails_5_2.gemfile"
77
+ - ruby_version: "ruby:2.6-buster"
78
+ gemfile: "gemfiles/rails_7_0.gemfile"
@@ -0,0 +1,63 @@
1
+ name: Changelog
2
+
3
+ on:
4
+ pull_request:
5
+ types: [closed]
6
+
7
+ release:
8
+ types: [published]
9
+
10
+ issues:
11
+ types: [closed, edited]
12
+
13
+ jobs:
14
+ generate_changelog:
15
+ runs-on: ubuntu-latest
16
+ name: Generate changelog for master branch
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ with:
20
+ fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
21
+
22
+ - name: Generate changelog
23
+ uses: charmixer/auto-changelog-action@v1
24
+ with:
25
+ token: ${{ secrets.GITHUB_TOKEN }}
26
+
27
+ - name: Commit files
28
+ env:
29
+ ACTION_EMAIL: action@github.com
30
+ ACTION_USERNAME: GitHub Action
31
+ run: |
32
+ git config --local user.email "$ACTION_EMAIL"
33
+ git config --local user.name "$ACTION_USERNAME"
34
+ git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo ::set-env name=push::1 || echo "No changes to CHANGELOG.md"
35
+
36
+ - name: Push changes
37
+ if: env.push == 1
38
+ env:
39
+ # CI_USER: ${{ secrets.YOUR_GITHUB_USER }}
40
+ CI_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
41
+ run: |
42
+ git push "https://$GITHUB_ACTOR:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:master
43
+
44
+ # - name: Push changelog to master
45
+ # if: env.push == 1
46
+ # uses: ad-m/github-push-action@master
47
+ # with:
48
+ # github_token: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
49
+ # branch: master
50
+
51
+ # - name: Cherry-pick changelog to development
52
+ # if: env.push == 1
53
+ # env:
54
+ # ACTION_EMAIL: action@github.com
55
+ # ACTION_USERNAME: GitHub Action
56
+ # run: |
57
+ # git config --local user.email "$ACTION_EMAIL"
58
+ # git config --local user.name "$ACTION_USERNAME"
59
+ # commit_hash=`git show HEAD | egrep commit\ .+$ | cut -d' ' -f2`
60
+ # git checkout development
61
+ # git pull
62
+ # git cherry-pick $commit_hash
63
+ # git push
@@ -0,0 +1,22 @@
1
+ name: reviewdog
2
+ on: [push, pull_request]
3
+ jobs:
4
+ rubocop:
5
+ name: runner / rubocop
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - name: Check out code
9
+ uses: actions/checkout@v2
10
+ - name: Read ruby version
11
+ run: echo ::set-output name=RUBY_VERSION::$(cat .ruby-version | cut -f 1,2 -d .)
12
+ id: rv
13
+ - uses: ruby/setup-ruby@v1
14
+ with:
15
+ ruby-version: "${{ steps.rv.outputs.RUBY_VERSION }}"
16
+ - uses: reviewdog/action-rubocop@v1
17
+ with:
18
+ filter_mode: nofilter
19
+ reporter: github-check
20
+ rubocop_version: 0.93.1
21
+ github_token: ${{ secrets.github_token }}
22
+ rubocop_extensions: rubocop-performance:1.10.2 rubocop-rails:2.9.1 rubocop-rspec:1.44.1
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,32 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - rubocop-rails
5
+ - rubocop-performance
6
+ - rubocop-rspec
7
+
8
+ AllCops:
9
+ Exclude:
10
+ - gemfiles/**/*.gemfile
11
+ - gemfiles/vendor/**/*
12
+ - spec/dummy_engine/dummy_engine.gemspec
13
+ - spec/schemas/**/*.rb
14
+
15
+ NewCops: enable
16
+
17
+ Gemspec/RequiredRubyVersion:
18
+ Exclude:
19
+ - 'ros-apartment.gemspec'
20
+
21
+ Metrics/BlockLength:
22
+ Exclude:
23
+ - spec/**/*.rb
24
+
25
+ Rails/RakeEnvironment:
26
+ Enabled: false
27
+
28
+ Rails/ApplicationRecord:
29
+ Enabled: false
30
+
31
+ Rails/Output:
32
+ Enabled: false
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,233 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-06-26 03:25:28 UTC using RuboCop version 0.93.1.
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
+ Lint/MixedRegexpCaptureTypes:
11
+ Exclude:
12
+ - 'lib/apartment/elevators/domain.rb'
13
+
14
+ # Offense count: 3
15
+ # Configuration parameters: IgnoredMethods.
16
+ Metrics/AbcSize:
17
+ Max: 28
18
+
19
+ # Offense count: 5
20
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
21
+ # ExcludedMethods: refine
22
+ Metrics/BlockLength:
23
+ Max: 83
24
+
25
+ # Offense count: 1
26
+ # Configuration parameters: CountComments, CountAsOne.
27
+ Metrics/ClassLength:
28
+ Max: 151
29
+
30
+ # Offense count: 6
31
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
32
+ Metrics/MethodLength:
33
+ Max: 24
34
+
35
+ # Offense count: 3
36
+ RSpec/AnyInstance:
37
+ Exclude:
38
+ - 'spec/unit/migrator_spec.rb'
39
+
40
+ # Offense count: 2
41
+ RSpec/BeforeAfterAll:
42
+ Exclude:
43
+ - 'spec/spec_helper.rb'
44
+ - 'spec/rails_helper.rb'
45
+ - 'spec/support/**/*.rb'
46
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
47
+ - 'spec/tasks/apartment_rake_spec.rb'
48
+
49
+ # Offense count: 18
50
+ # Configuration parameters: Prefixes.
51
+ # Prefixes: when, with, without
52
+ RSpec/ContextWording:
53
+ Exclude:
54
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
55
+ - 'spec/examples/generic_adapter_custom_configuration_example.rb'
56
+ - 'spec/examples/schema_adapter_examples.rb'
57
+ - 'spec/support/contexts.rb'
58
+ - 'spec/tasks/apartment_rake_spec.rb'
59
+ - 'spec/tenant_spec.rb'
60
+
61
+ # Offense count: 4
62
+ # Configuration parameters: IgnoredMetadata.
63
+ RSpec/DescribeClass:
64
+ Exclude:
65
+ - 'spec/integration/apartment_rake_integration_spec.rb'
66
+ - 'spec/integration/query_caching_spec.rb'
67
+ - 'spec/integration/use_within_an_engine_spec.rb'
68
+ - 'spec/tasks/apartment_rake_spec.rb'
69
+
70
+ # Offense count: 12
71
+ # Cop supports --auto-correct.
72
+ # Configuration parameters: SkipBlocks, EnforcedStyle.
73
+ # SupportedStyles: described_class, explicit
74
+ RSpec/DescribedClass:
75
+ Exclude:
76
+ - 'spec/apartment_spec.rb'
77
+ - 'spec/tenant_spec.rb'
78
+ - 'spec/unit/elevators/host_hash_spec.rb'
79
+ - 'spec/unit/migrator_spec.rb'
80
+
81
+ # Offense count: 5
82
+ # Cop supports --auto-correct.
83
+ RSpec/EmptyLineAfterFinalLet:
84
+ Exclude:
85
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
86
+ - 'spec/examples/schema_adapter_examples.rb'
87
+
88
+ # Offense count: 14
89
+ # Configuration parameters: Max.
90
+ RSpec/ExampleLength:
91
+ Exclude:
92
+ - 'spec/examples/generic_adapter_custom_configuration_example.rb'
93
+ - 'spec/examples/generic_adapter_examples.rb'
94
+ - 'spec/examples/schema_adapter_examples.rb'
95
+ - 'spec/integration/query_caching_spec.rb'
96
+ - 'spec/tenant_spec.rb'
97
+
98
+ # Offense count: 60
99
+ # Cop supports --auto-correct.
100
+ # Configuration parameters: CustomTransform, IgnoredWords.
101
+ RSpec/ExampleWording:
102
+ Exclude:
103
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
104
+ - 'spec/apartment_spec.rb'
105
+ - 'spec/examples/connection_adapter_examples.rb'
106
+ - 'spec/examples/generic_adapter_custom_configuration_example.rb'
107
+ - 'spec/examples/generic_adapter_examples.rb'
108
+ - 'spec/examples/schema_adapter_examples.rb'
109
+ - 'spec/integration/apartment_rake_integration_spec.rb'
110
+ - 'spec/integration/use_within_an_engine_spec.rb'
111
+ - 'spec/tasks/apartment_rake_spec.rb'
112
+ - 'spec/tenant_spec.rb'
113
+
114
+ # Offense count: 13
115
+ # Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly.
116
+ RSpec/FilePath:
117
+ Exclude:
118
+ - 'spec/adapters/mysql2_adapter_spec.rb'
119
+ - 'spec/adapters/postgresql_adapter_spec.rb'
120
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
121
+ - 'spec/tenant_spec.rb'
122
+ - 'spec/unit/config_spec.rb'
123
+ - 'spec/unit/elevators/domain_spec.rb'
124
+ - 'spec/unit/elevators/first_subdomain_spec.rb'
125
+ - 'spec/unit/elevators/generic_spec.rb'
126
+ - 'spec/unit/elevators/host_hash_spec.rb'
127
+ - 'spec/unit/elevators/host_spec.rb'
128
+ - 'spec/unit/elevators/subdomain_spec.rb'
129
+ - 'spec/unit/migrator_spec.rb'
130
+
131
+ # Offense count: 1
132
+ # Cop supports --auto-correct.
133
+ # Configuration parameters: EnforcedStyle.
134
+ # SupportedStyles: implicit, each, example
135
+ RSpec/HookArgument:
136
+ Exclude:
137
+ - 'spec/support/setup.rb'
138
+
139
+ # Offense count: 4
140
+ # Cop supports --auto-correct.
141
+ RSpec/HooksBeforeExamples:
142
+ Exclude:
143
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
144
+ - 'spec/examples/schema_adapter_examples.rb'
145
+
146
+ # Offense count: 18
147
+ # Configuration parameters: AssignmentOnly.
148
+ RSpec/InstanceVariable:
149
+ Exclude:
150
+ - 'spec/examples/generic_adapter_examples.rb'
151
+ - 'spec/examples/schema_adapter_examples.rb'
152
+ - 'spec/integration/apartment_rake_integration_spec.rb'
153
+ - 'spec/integration/use_within_an_engine_spec.rb'
154
+ - 'spec/tasks/apartment_rake_spec.rb'
155
+
156
+ # Offense count: 1
157
+ # Cop supports --auto-correct.
158
+ RSpec/LeadingSubject:
159
+ Exclude:
160
+
161
+ # Offense count: 2
162
+ RSpec/LeakyConstantDeclaration:
163
+ Exclude:
164
+ - 'spec/examples/generic_adapters_callbacks_examples.rb'
165
+ - 'spec/unit/elevators/generic_spec.rb'
166
+
167
+ # Offense count: 35
168
+ # Configuration parameters: EnforcedStyle.
169
+ # SupportedStyles: have_received, receive
170
+ RSpec/MessageSpies:
171
+ Exclude:
172
+ - 'spec/examples/generic_adapter_custom_configuration_example.rb'
173
+ - 'spec/integration/apartment_rake_integration_spec.rb'
174
+ - 'spec/integration/use_within_an_engine_spec.rb'
175
+ - 'spec/tasks/apartment_rake_spec.rb'
176
+ - 'spec/unit/elevators/domain_spec.rb'
177
+ - 'spec/unit/elevators/generic_spec.rb'
178
+ - 'spec/unit/elevators/host_hash_spec.rb'
179
+ - 'spec/unit/elevators/host_spec.rb'
180
+ - 'spec/unit/elevators/subdomain_spec.rb'
181
+ - 'spec/unit/migrator_spec.rb'
182
+
183
+ # Offense count: 29
184
+ RSpec/MultipleExpectations:
185
+ Max: 4
186
+
187
+ # Offense count: 47
188
+ # Configuration parameters: IgnoreSharedExamples.
189
+ RSpec/NamedSubject:
190
+ Exclude:
191
+ - 'spec/adapters/mysql2_adapter_spec.rb'
192
+ - 'spec/adapters/sqlite3_adapter_spec.rb'
193
+ - 'spec/support/contexts.rb'
194
+ - 'spec/support/requirements.rb'
195
+ - 'spec/tenant_spec.rb'
196
+
197
+ # Offense count: 24
198
+ RSpec/NestedGroups:
199
+ Max: 5
200
+
201
+ # Offense count: 6
202
+ # Cop supports --auto-correct.
203
+ # Configuration parameters: EnforcedStyle.
204
+ # SupportedStyles: and_return, block
205
+ RSpec/ReturnFromStub:
206
+ Exclude:
207
+ - 'spec/integration/apartment_rake_integration_spec.rb'
208
+ - 'spec/unit/migrator_spec.rb'
209
+
210
+ # Offense count: 4
211
+ # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
212
+ RSpec/VerifiedDoubles:
213
+ Exclude:
214
+ - 'spec/integration/apartment_rake_integration_spec.rb'
215
+ - 'spec/unit/elevators/first_subdomain_spec.rb'
216
+
217
+ # Offense count: 17
218
+ Style/Documentation:
219
+ Exclude:
220
+ - 'spec/**/*'
221
+ - 'test/**/*'
222
+ - 'lib/apartment/adapters/jdbc_mysql_adapter.rb'
223
+ - 'lib/apartment/adapters/postgis_adapter.rb'
224
+ - 'lib/apartment/adapters/postgresql_adapter.rb'
225
+ - 'lib/apartment/adapters/sqlite3_adapter.rb'
226
+ - 'lib/apartment/custom_console.rb'
227
+ - 'lib/apartment/deprecation.rb'
228
+ - 'lib/apartment/migrator.rb'
229
+ - 'lib/apartment/model.rb'
230
+ - 'lib/apartment/railtie.rb'
231
+ - 'lib/apartment/tasks/enhancements.rb'
232
+ - 'lib/apartment/tasks/task_helper.rb'
233
+ - 'lib/generators/apartment/install/install_generator.rb'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.5
data/.story_branch.yml ADDED
@@ -0,0 +1,5 @@
1
+ ---
2
+ tracker: github
3
+ issue_placement: beginning
4
+ project_id:
5
+ - rails-on-services/apartment
data/Appraisals CHANGED
@@ -1,71 +1,58 @@
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
1
+ # frozen_string_literal: true
2
+
3
+ appraise 'rails-5-2' do
4
+ gem 'rails', '~> 5.2.0'
7
5
  platforms :jruby do
8
- gem 'activerecord-jdbc-adapter', '~> 1.3'
9
- gem 'activerecord-jdbcpostgresql-adapter', '~> 1.3'
10
- gem 'activerecord-jdbcmysql-adapter', '~> 1.3'
6
+ gem 'activerecord-jdbc-adapter', '~> 52.0'
7
+ gem 'activerecord-jdbcpostgresql-adapter', '~> 52.0'
8
+ gem 'activerecord-jdbcmysql-adapter', '~> 52.0'
11
9
  end
12
10
  end
13
11
 
14
- appraise "rails-5-0" do
15
- gem "rails", "~> 5.0.0"
12
+ appraise 'rails-6-0' do
13
+ gem 'rails', '~> 6.0.0'
16
14
  platforms :ruby do
17
- gem "pg", "< 1.0.0"
15
+ gem 'sqlite3', '~> 1.4'
18
16
  end
19
17
  platforms :jruby do
20
- gem 'activerecord-jdbc-adapter', '~> 50.0'
21
- gem 'activerecord-jdbcpostgresql-adapter', '~> 50.0'
22
- gem 'activerecord-jdbcmysql-adapter', '~> 50.0'
18
+ gem 'activerecord-jdbc-adapter', '~> 60.0'
19
+ gem 'activerecord-jdbcpostgresql-adapter', '~> 60.0'
20
+ gem 'activerecord-jdbcmysql-adapter', '~> 60.0'
23
21
  end
24
22
  end
25
23
 
26
- appraise "rails-5-1" do
27
- gem "rails", "~> 5.1.0"
24
+ appraise 'rails-6-1' do
25
+ gem 'rails', '~> 6.1.0'
28
26
  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'
27
+ gem 'sqlite3', '~> 1.4'
35
28
  end
36
- end
37
-
38
- appraise "rails-5-2" do
39
- gem "rails", "~> 5.2.0"
40
29
  platforms :jruby do
41
- gem 'activerecord-jdbc-adapter', '~> 52.0'
42
- gem 'activerecord-jdbcpostgresql-adapter', '~> 52.0'
43
- gem 'activerecord-jdbcmysql-adapter', '~> 52.0'
30
+ gem 'activerecord-jdbc-adapter', '~> 61.0'
31
+ gem 'activerecord-jdbcpostgresql-adapter', '~> 61.0'
32
+ gem 'activerecord-jdbcmysql-adapter', '~> 61.0'
44
33
  end
45
34
  end
46
35
 
47
-
48
- appraise "rails-6-0" do
49
- gem "rails", "~> 6.0.0.rc1"
36
+ appraise 'rails-7-0' do
37
+ gem 'rails', '~> 7.0.0'
50
38
  platforms :ruby do
51
39
  gem 'sqlite3', '~> 1.4'
52
40
  end
53
41
  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'
42
+ gem 'activerecord-jdbc-adapter', '~> 61.0'
43
+ gem 'activerecord-jdbcpostgresql-adapter', '~> 61.0'
44
+ gem 'activerecord-jdbcmysql-adapter', '~> 61.0'
57
45
  end
58
46
  end
59
47
 
60
-
61
- appraise "rails-master" do
62
- gem "rails", git: 'https://github.com/rails/rails.git'
48
+ appraise 'rails-master' do
49
+ gem 'rails', git: 'https://github.com/rails/rails.git'
63
50
  platforms :ruby do
64
51
  gem 'sqlite3', '~> 1.4'
65
52
  end
66
53
  platforms :jruby do
67
- gem 'activerecord-jdbc-adapter', '~> 52.0'
68
- gem 'activerecord-jdbcpostgresql-adapter', '~> 52.0'
69
- gem 'activerecord-jdbcmysql-adapter', '~> 52.0'
54
+ gem 'activerecord-jdbc-adapter', '~> 61.0'
55
+ gem 'activerecord-jdbcpostgresql-adapter', '~> 61.0'
56
+ gem 'activerecord-jdbcmysql-adapter', '~> 61.0'
70
57
  end
71
58
  end