├── .gitignore ├── .rspec ├── .rubocop.yml ├── Dockerfile ├── Gemfile ├── Gemfile.activerecord-6.0.lock ├── Gemfile.activerecord-6.1.lock ├── Gemfile.activerecord-7.0.lock ├── Gemfile.activerecord-7.1.lock ├── Gemfile.activerecord-7.2.lock ├── Gemfile.lock ├── Jenkinsfile ├── LICENSE ├── README.md ├── Rakefile ├── bin ├── rake ├── rspec └── rubocop ├── docker-compose.yml ├── lib ├── outrigger.rb ├── outrigger │ ├── cops │ │ └── migration │ │ │ └── tagged.rb │ ├── migrator.rb │ ├── railtie.rb │ ├── taggable.rb │ ├── taggable_proxy.rb │ └── version.rb └── tasks │ └── outrigger.rake ├── outrigger.gemspec └── spec ├── outrigger ├── cops │ └── migration │ │ └── tagged_spec.rb ├── migrator_spec.rb ├── outrigger_spec.rb ├── railtie_spec.rb ├── taggable_proxy_spec.rb └── taggable_spec.rb └── spec_helper.rb /.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle 2 | /.byebug_history 3 | /.rspec_status 4 | /.ruby-version 5 | /.yardoc 6 | /_yardoc/ 7 | /coverage/ 8 | /**/*.gem 9 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | require: 2 | - rubocop-rake 3 | - rubocop-rspec 4 | 5 | AllCops: 6 | NewCops: enable 7 | TargetRubyVersion: 2.6 8 | Exclude: 9 | - 'gemfiles/*' 10 | 11 | Metrics: 12 | Enabled: false 13 | Bundler/DuplicatedGem: 14 | Enabled: false 15 | RSpec/ExampleLength: 16 | Enabled: false 17 | RSpec/MultipleExpectations: 18 | Enabled: false 19 | RSpec/SpecFilePathFormat: 20 | Exclude: 21 | - 'spec/outrigger/cops/**/*.rb' 22 | Style/Documentation: 23 | Enabled: false 24 | Gemspec/DevelopmentDependencies: 25 | EnforcedStyle: gemspec -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG RUBY_VERSION=3.2 2 | FROM ruby:${RUBY_VERSION} 3 | 4 | WORKDIR /app 5 | 6 | RUN /bin/bash -lc "gem install bundler -v 2.4.20" 7 | 8 | ARG BUNDLE_LOCKFILE 9 | ENV BUNDLE_LOCKFILE $BUNDLE_LOCKFILE 10 | 11 | RUN echo "gem: --no-document" >> ~/.gemrc 12 | 13 | COPY . /app 14 | RUN /bin/bash -lc "bundle install --jobs 5" 15 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | plugin 'bundler-multilock', '1.2.0' 6 | return unless Plugin.installed?('bundler-multilock') 7 | 8 | Plugin.send(:load_plugin, 'bundler-multilock') 9 | 10 | gemspec 11 | 12 | lockfile 'activerecord-6.0' do 13 | gem 'activerecord', '~> 6.0.0' 14 | gem 'railties', '~> 6.0.0' 15 | end 16 | 17 | lockfile 'activerecord-6.1' do 18 | gem 'activerecord', '~> 6.1.0' 19 | gem 'railties', '~> 6.1.0' 20 | end 21 | 22 | lockfile 'activerecord-7.0' do 23 | gem 'activerecord', '~> 7.0.0' 24 | gem 'railties', '~> 7.0.0' 25 | end 26 | 27 | lockfile 'activerecord-7.1' do 28 | gem 'activerecord', '~> 7.1.0' 29 | gem 'railties', '~> 7.1.0' 30 | end 31 | 32 | lockfile 'activerecord-7.2' do 33 | gem 'activerecord', '~> 7.2.0' 34 | gem 'railties', '~> 7.2.0' 35 | end 36 | 37 | lockfile do 38 | gem 'activerecord', '~> 8.0.0' 39 | gem 'railties', '~> 8.0.0' 40 | end 41 | -------------------------------------------------------------------------------- /Gemfile.activerecord-6.0.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | outrigger (3.0.3) 5 | activerecord (>= 6.0, <= 8.0) 6 | railties (>= 6.0, <= 8.0) 7 | 8 | GEM 9 | remote: https://rubygems.org/ 10 | specs: 11 | actionpack (6.0.6.1) 12 | actionview (= 6.0.6.1) 13 | activesupport (= 6.0.6.1) 14 | rack (~> 2.0, >= 2.0.8) 15 | rack-test (>= 0.6.3) 16 | rails-dom-testing (~> 2.0) 17 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 18 | actionview (6.0.6.1) 19 | activesupport (= 6.0.6.1) 20 | builder (~> 3.1) 21 | erubi (~> 1.4) 22 | rails-dom-testing (~> 2.0) 23 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 24 | activemodel (6.0.6.1) 25 | activesupport (= 6.0.6.1) 26 | activerecord (6.0.6.1) 27 | activemodel (= 6.0.6.1) 28 | activesupport (= 6.0.6.1) 29 | activesupport (6.0.6.1) 30 | concurrent-ruby (~> 1.0, >= 1.0.2) 31 | i18n (>= 0.7, < 2) 32 | minitest (~> 5.1) 33 | tzinfo (~> 1.1) 34 | zeitwerk (~> 2.2, >= 2.2.2) 35 | ast (2.4.2) 36 | builder (3.3.0) 37 | byebug (11.1.3) 38 | concurrent-ruby (1.3.4) 39 | crass (1.0.6) 40 | diff-lcs (1.6.0) 41 | docile (1.4.1) 42 | erubi (1.13.1) 43 | i18n (1.14.7) 44 | concurrent-ruby (~> 1.0) 45 | json (2.10.1) 46 | language_server-protocol (3.17.0.4) 47 | lint_roller (1.1.0) 48 | loofah (2.24.0) 49 | crass (~> 1.0.2) 50 | nokogiri (>= 1.12.0) 51 | method_source (1.1.0) 52 | minitest (5.25.4) 53 | nokogiri (1.18.2-arm64-darwin) 54 | racc (~> 1.4) 55 | nokogiri (1.18.2-x86_64-darwin) 56 | racc (~> 1.4) 57 | nokogiri (1.18.2-x86_64-linux-gnu) 58 | racc (~> 1.4) 59 | parallel (1.26.3) 60 | parser (3.3.7.1) 61 | ast (~> 2.4.1) 62 | racc 63 | racc (1.8.1) 64 | rack (2.2.10) 65 | rack-test (2.2.0) 66 | rack (>= 1.3) 67 | rails-dom-testing (2.2.0) 68 | activesupport (>= 5.0.0) 69 | minitest 70 | nokogiri (>= 1.6) 71 | rails-html-sanitizer (1.6.2) 72 | loofah (~> 2.21) 73 | nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) 74 | railties (6.0.6.1) 75 | actionpack (= 6.0.6.1) 76 | activesupport (= 6.0.6.1) 77 | method_source 78 | rake (>= 0.8.7) 79 | thor (>= 0.20.3, < 2.0) 80 | rainbow (3.1.1) 81 | rake (13.2.1) 82 | regexp_parser (2.10.0) 83 | rspec (3.13.0) 84 | rspec-core (~> 3.13.0) 85 | rspec-expectations (~> 3.13.0) 86 | rspec-mocks (~> 3.13.0) 87 | rspec-core (3.13.3) 88 | rspec-support (~> 3.13.0) 89 | rspec-expectations (3.13.3) 90 | diff-lcs (>= 1.2.0, < 2.0) 91 | rspec-support (~> 3.13.0) 92 | rspec-mocks (3.13.2) 93 | diff-lcs (>= 1.2.0, < 2.0) 94 | rspec-support (~> 3.13.0) 95 | rspec-support (3.13.2) 96 | rubocop (1.72.0) 97 | json (~> 2.3) 98 | language_server-protocol (~> 3.17.0.2) 99 | lint_roller (~> 1.1.0) 100 | parallel (~> 1.10) 101 | parser (>= 3.3.0.2) 102 | rainbow (>= 2.2.2, < 4.0) 103 | regexp_parser (>= 2.9.3, < 3.0) 104 | rubocop-ast (>= 1.38.0, < 2.0) 105 | ruby-progressbar (~> 1.7) 106 | unicode-display_width (>= 2.4.0, < 4.0) 107 | rubocop-ast (1.38.0) 108 | parser (>= 3.3.1.0) 109 | rubocop-capybara (2.21.0) 110 | rubocop (~> 1.41) 111 | rubocop-factory_bot (2.26.1) 112 | rubocop (~> 1.61) 113 | rubocop-rake (0.6.0) 114 | rubocop (~> 1.0) 115 | rubocop-rspec (2.31.0) 116 | rubocop (~> 1.40) 117 | rubocop-capybara (~> 2.17) 118 | rubocop-factory_bot (~> 2.22) 119 | rubocop-rspec_rails (~> 2.28) 120 | rubocop-rspec_rails (2.29.1) 121 | rubocop (~> 1.61) 122 | ruby-progressbar (1.13.0) 123 | simplecov (0.22.0) 124 | docile (~> 1.1) 125 | simplecov-html (~> 0.11) 126 | simplecov_json_formatter (~> 0.1) 127 | simplecov-html (0.13.1) 128 | simplecov_json_formatter (0.1.4) 129 | thor (1.3.2) 130 | thread_safe (0.3.6) 131 | tzinfo (1.2.11) 132 | thread_safe (~> 0.1) 133 | unicode-display_width (3.1.4) 134 | unicode-emoji (~> 4.0, >= 4.0.4) 135 | unicode-emoji (4.0.4) 136 | zeitwerk (2.7.1) 137 | 138 | PLATFORMS 139 | arm64-darwin 140 | x86_64-darwin 141 | x86_64-linux 142 | 143 | DEPENDENCIES 144 | activerecord (~> 6.0.0) 145 | bundler (~> 2.2) 146 | byebug (~> 11.1) 147 | outrigger! 148 | railties (~> 6.0.0) 149 | rake (~> 13.0) 150 | rspec (~> 3.7) 151 | rubocop (~> 1.20) 152 | rubocop-rake (~> 0.6) 153 | rubocop-rspec (~> 2.4) 154 | simplecov (~> 0.21) 155 | 156 | BUNDLED WITH 157 | 2.4.20 158 | -------------------------------------------------------------------------------- /Gemfile.activerecord-6.1.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | outrigger (3.0.3) 5 | activerecord (>= 6.0, <= 8.0) 6 | railties (>= 6.0, <= 8.0) 7 | 8 | GEM 9 | remote: https://rubygems.org/ 10 | specs: 11 | actionpack (6.1.7.10) 12 | actionview (= 6.1.7.10) 13 | activesupport (= 6.1.7.10) 14 | rack (~> 2.0, >= 2.0.9) 15 | rack-test (>= 0.6.3) 16 | rails-dom-testing (~> 2.0) 17 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 18 | actionview (6.1.7.10) 19 | activesupport (= 6.1.7.10) 20 | builder (~> 3.1) 21 | erubi (~> 1.4) 22 | rails-dom-testing (~> 2.0) 23 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 24 | activemodel (6.1.7.10) 25 | activesupport (= 6.1.7.10) 26 | activerecord (6.1.7.10) 27 | activemodel (= 6.1.7.10) 28 | activesupport (= 6.1.7.10) 29 | activesupport (6.1.7.10) 30 | concurrent-ruby (~> 1.0, >= 1.0.2) 31 | i18n (>= 1.6, < 2) 32 | minitest (>= 5.1) 33 | tzinfo (~> 2.0) 34 | zeitwerk (~> 2.3) 35 | ast (2.4.2) 36 | builder (3.3.0) 37 | byebug (11.1.3) 38 | concurrent-ruby (1.3.4) 39 | crass (1.0.6) 40 | diff-lcs (1.6.0) 41 | docile (1.4.1) 42 | erubi (1.13.1) 43 | i18n (1.14.7) 44 | concurrent-ruby (~> 1.0) 45 | json (2.10.1) 46 | language_server-protocol (3.17.0.4) 47 | lint_roller (1.1.0) 48 | loofah (2.24.0) 49 | crass (~> 1.0.2) 50 | nokogiri (>= 1.12.0) 51 | method_source (1.1.0) 52 | minitest (5.25.4) 53 | nokogiri (1.18.2-arm64-darwin) 54 | racc (~> 1.4) 55 | nokogiri (1.18.2-x86_64-darwin) 56 | racc (~> 1.4) 57 | nokogiri (1.18.2-x86_64-linux-gnu) 58 | racc (~> 1.4) 59 | parallel (1.26.3) 60 | parser (3.3.7.1) 61 | ast (~> 2.4.1) 62 | racc 63 | racc (1.8.1) 64 | rack (2.2.10) 65 | rack-test (2.2.0) 66 | rack (>= 1.3) 67 | rails-dom-testing (2.2.0) 68 | activesupport (>= 5.0.0) 69 | minitest 70 | nokogiri (>= 1.6) 71 | rails-html-sanitizer (1.6.2) 72 | loofah (~> 2.21) 73 | nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) 74 | railties (6.1.7.10) 75 | actionpack (= 6.1.7.10) 76 | activesupport (= 6.1.7.10) 77 | method_source 78 | rake (>= 12.2) 79 | thor (~> 1.0) 80 | rainbow (3.1.1) 81 | rake (13.2.1) 82 | regexp_parser (2.10.0) 83 | rspec (3.13.0) 84 | rspec-core (~> 3.13.0) 85 | rspec-expectations (~> 3.13.0) 86 | rspec-mocks (~> 3.13.0) 87 | rspec-core (3.13.3) 88 | rspec-support (~> 3.13.0) 89 | rspec-expectations (3.13.3) 90 | diff-lcs (>= 1.2.0, < 2.0) 91 | rspec-support (~> 3.13.0) 92 | rspec-mocks (3.13.2) 93 | diff-lcs (>= 1.2.0, < 2.0) 94 | rspec-support (~> 3.13.0) 95 | rspec-support (3.13.2) 96 | rubocop (1.72.0) 97 | json (~> 2.3) 98 | language_server-protocol (~> 3.17.0.2) 99 | lint_roller (~> 1.1.0) 100 | parallel (~> 1.10) 101 | parser (>= 3.3.0.2) 102 | rainbow (>= 2.2.2, < 4.0) 103 | regexp_parser (>= 2.9.3, < 3.0) 104 | rubocop-ast (>= 1.38.0, < 2.0) 105 | ruby-progressbar (~> 1.7) 106 | unicode-display_width (>= 2.4.0, < 4.0) 107 | rubocop-ast (1.38.0) 108 | parser (>= 3.3.1.0) 109 | rubocop-capybara (2.21.0) 110 | rubocop (~> 1.41) 111 | rubocop-factory_bot (2.26.1) 112 | rubocop (~> 1.61) 113 | rubocop-rake (0.6.0) 114 | rubocop (~> 1.0) 115 | rubocop-rspec (2.31.0) 116 | rubocop (~> 1.40) 117 | rubocop-capybara (~> 2.17) 118 | rubocop-factory_bot (~> 2.22) 119 | rubocop-rspec_rails (~> 2.28) 120 | rubocop-rspec_rails (2.29.1) 121 | rubocop (~> 1.61) 122 | ruby-progressbar (1.13.0) 123 | simplecov (0.22.0) 124 | docile (~> 1.1) 125 | simplecov-html (~> 0.11) 126 | simplecov_json_formatter (~> 0.1) 127 | simplecov-html (0.13.1) 128 | simplecov_json_formatter (0.1.4) 129 | thor (1.3.2) 130 | tzinfo (2.0.6) 131 | concurrent-ruby (~> 1.0) 132 | unicode-display_width (3.1.4) 133 | unicode-emoji (~> 4.0, >= 4.0.4) 134 | unicode-emoji (4.0.4) 135 | zeitwerk (2.7.1) 136 | 137 | PLATFORMS 138 | arm64-darwin 139 | x86_64-darwin 140 | x86_64-linux 141 | 142 | DEPENDENCIES 143 | activerecord (~> 6.1.0) 144 | bundler (~> 2.2) 145 | byebug (~> 11.1) 146 | outrigger! 147 | railties (~> 6.1.0) 148 | rake (~> 13.0) 149 | rspec (~> 3.7) 150 | rubocop (~> 1.20) 151 | rubocop-rake (~> 0.6) 152 | rubocop-rspec (~> 2.4) 153 | simplecov (~> 0.21) 154 | 155 | BUNDLED WITH 156 | 2.4.20 157 | -------------------------------------------------------------------------------- /Gemfile.activerecord-7.0.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | outrigger (3.0.3) 5 | activerecord (>= 6.0, <= 8.0) 6 | railties (>= 6.0, <= 8.0) 7 | 8 | GEM 9 | remote: https://rubygems.org/ 10 | specs: 11 | actionpack (7.0.8.6) 12 | actionview (= 7.0.8.6) 13 | activesupport (= 7.0.8.6) 14 | rack (~> 2.0, >= 2.2.4) 15 | rack-test (>= 0.6.3) 16 | rails-dom-testing (~> 2.0) 17 | rails-html-sanitizer (~> 1.0, >= 1.2.0) 18 | actionview (7.0.8.6) 19 | activesupport (= 7.0.8.6) 20 | builder (~> 3.1) 21 | erubi (~> 1.4) 22 | rails-dom-testing (~> 2.0) 23 | rails-html-sanitizer (~> 1.1, >= 1.2.0) 24 | activemodel (7.0.8.6) 25 | activesupport (= 7.0.8.6) 26 | activerecord (7.0.8.6) 27 | activemodel (= 7.0.8.6) 28 | activesupport (= 7.0.8.6) 29 | activesupport (7.0.8.6) 30 | concurrent-ruby (~> 1.0, >= 1.0.2) 31 | i18n (>= 1.6, < 2) 32 | minitest (>= 5.1) 33 | tzinfo (~> 2.0) 34 | ast (2.4.2) 35 | builder (3.3.0) 36 | byebug (11.1.3) 37 | concurrent-ruby (1.3.4) 38 | crass (1.0.6) 39 | diff-lcs (1.6.0) 40 | docile (1.4.1) 41 | erubi (1.13.1) 42 | i18n (1.14.7) 43 | concurrent-ruby (~> 1.0) 44 | json (2.10.1) 45 | language_server-protocol (3.17.0.4) 46 | lint_roller (1.1.0) 47 | loofah (2.24.0) 48 | crass (~> 1.0.2) 49 | nokogiri (>= 1.12.0) 50 | method_source (1.1.0) 51 | minitest (5.25.4) 52 | nokogiri (1.18.2-arm64-darwin) 53 | racc (~> 1.4) 54 | nokogiri (1.18.2-x86_64-darwin) 55 | racc (~> 1.4) 56 | nokogiri (1.18.2-x86_64-linux-gnu) 57 | racc (~> 1.4) 58 | parallel (1.26.3) 59 | parser (3.3.7.1) 60 | ast (~> 2.4.1) 61 | racc 62 | racc (1.8.1) 63 | rack (2.2.10) 64 | rack-test (2.2.0) 65 | rack (>= 1.3) 66 | rails-dom-testing (2.2.0) 67 | activesupport (>= 5.0.0) 68 | minitest 69 | nokogiri (>= 1.6) 70 | rails-html-sanitizer (1.6.2) 71 | loofah (~> 2.21) 72 | nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) 73 | railties (7.0.8.6) 74 | actionpack (= 7.0.8.6) 75 | activesupport (= 7.0.8.6) 76 | method_source 77 | rake (>= 12.2) 78 | thor (~> 1.0) 79 | zeitwerk (~> 2.5) 80 | rainbow (3.1.1) 81 | rake (13.2.1) 82 | regexp_parser (2.10.0) 83 | rspec (3.13.0) 84 | rspec-core (~> 3.13.0) 85 | rspec-expectations (~> 3.13.0) 86 | rspec-mocks (~> 3.13.0) 87 | rspec-core (3.13.3) 88 | rspec-support (~> 3.13.0) 89 | rspec-expectations (3.13.3) 90 | diff-lcs (>= 1.2.0, < 2.0) 91 | rspec-support (~> 3.13.0) 92 | rspec-mocks (3.13.2) 93 | diff-lcs (>= 1.2.0, < 2.0) 94 | rspec-support (~> 3.13.0) 95 | rspec-support (3.13.2) 96 | rubocop (1.72.0) 97 | json (~> 2.3) 98 | language_server-protocol (~> 3.17.0.2) 99 | lint_roller (~> 1.1.0) 100 | parallel (~> 1.10) 101 | parser (>= 3.3.0.2) 102 | rainbow (>= 2.2.2, < 4.0) 103 | regexp_parser (>= 2.9.3, < 3.0) 104 | rubocop-ast (>= 1.38.0, < 2.0) 105 | ruby-progressbar (~> 1.7) 106 | unicode-display_width (>= 2.4.0, < 4.0) 107 | rubocop-ast (1.38.0) 108 | parser (>= 3.3.1.0) 109 | rubocop-capybara (2.21.0) 110 | rubocop (~> 1.41) 111 | rubocop-factory_bot (2.26.1) 112 | rubocop (~> 1.61) 113 | rubocop-rake (0.6.0) 114 | rubocop (~> 1.0) 115 | rubocop-rspec (2.31.0) 116 | rubocop (~> 1.40) 117 | rubocop-capybara (~> 2.17) 118 | rubocop-factory_bot (~> 2.22) 119 | rubocop-rspec_rails (~> 2.28) 120 | rubocop-rspec_rails (2.29.1) 121 | rubocop (~> 1.61) 122 | ruby-progressbar (1.13.0) 123 | simplecov (0.22.0) 124 | docile (~> 1.1) 125 | simplecov-html (~> 0.11) 126 | simplecov_json_formatter (~> 0.1) 127 | simplecov-html (0.13.1) 128 | simplecov_json_formatter (0.1.4) 129 | thor (1.3.2) 130 | tzinfo (2.0.6) 131 | concurrent-ruby (~> 1.0) 132 | unicode-display_width (3.1.4) 133 | unicode-emoji (~> 4.0, >= 4.0.4) 134 | unicode-emoji (4.0.4) 135 | zeitwerk (2.7.1) 136 | 137 | PLATFORMS 138 | arm64-darwin 139 | x86_64-darwin 140 | x86_64-linux 141 | 142 | DEPENDENCIES 143 | activerecord (~> 7.0.0) 144 | bundler (~> 2.2) 145 | byebug (~> 11.1) 146 | outrigger! 147 | railties (~> 7.0.0) 148 | rake (~> 13.0) 149 | rspec (~> 3.7) 150 | rubocop (~> 1.20) 151 | rubocop-rake (~> 0.6) 152 | rubocop-rspec (~> 2.4) 153 | simplecov (~> 0.21) 154 | 155 | BUNDLED WITH 156 | 2.4.20 157 | -------------------------------------------------------------------------------- /Gemfile.activerecord-7.1.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | outrigger (3.0.3) 5 | activerecord (>= 6.0, <= 8.0) 6 | railties (>= 6.0, <= 8.0) 7 | 8 | GEM 9 | remote: https://rubygems.org/ 10 | specs: 11 | actionpack (7.1.4) 12 | actionview (= 7.1.4) 13 | activesupport (= 7.1.4) 14 | nokogiri (>= 1.8.5) 15 | racc 16 | rack (>= 2.2.4) 17 | rack-session (>= 1.0.1) 18 | rack-test (>= 0.6.3) 19 | rails-dom-testing (~> 2.2) 20 | rails-html-sanitizer (~> 1.6) 21 | actionview (7.1.4) 22 | activesupport (= 7.1.4) 23 | builder (~> 3.1) 24 | erubi (~> 1.11) 25 | rails-dom-testing (~> 2.2) 26 | rails-html-sanitizer (~> 1.6) 27 | activemodel (7.1.4) 28 | activesupport (= 7.1.4) 29 | activerecord (7.1.4) 30 | activemodel (= 7.1.4) 31 | activesupport (= 7.1.4) 32 | timeout (>= 0.4.0) 33 | activesupport (7.1.4) 34 | base64 35 | bigdecimal 36 | concurrent-ruby (~> 1.0, >= 1.0.2) 37 | connection_pool (>= 2.2.5) 38 | drb 39 | i18n (>= 1.6, < 2) 40 | minitest (>= 5.1) 41 | mutex_m 42 | tzinfo (~> 2.0) 43 | ast (2.4.2) 44 | base64 (0.2.0) 45 | bigdecimal (3.1.9) 46 | builder (3.3.0) 47 | byebug (11.1.3) 48 | concurrent-ruby (1.3.4) 49 | connection_pool (2.5.0) 50 | crass (1.0.6) 51 | date (3.4.1) 52 | diff-lcs (1.6.0) 53 | docile (1.4.1) 54 | drb (2.2.1) 55 | erubi (1.13.1) 56 | i18n (1.14.7) 57 | concurrent-ruby (~> 1.0) 58 | io-console (0.8.0) 59 | irb (1.15.1) 60 | pp (>= 0.6.0) 61 | rdoc (>= 4.0.0) 62 | reline (>= 0.4.2) 63 | json (2.10.1) 64 | language_server-protocol (3.17.0.4) 65 | lint_roller (1.1.0) 66 | loofah (2.24.0) 67 | crass (~> 1.0.2) 68 | nokogiri (>= 1.12.0) 69 | minitest (5.25.4) 70 | mutex_m (0.2.0) 71 | nokogiri (1.18.2-arm64-darwin) 72 | racc (~> 1.4) 73 | nokogiri (1.18.2-x86_64-darwin) 74 | racc (~> 1.4) 75 | nokogiri (1.18.2-x86_64-linux-gnu) 76 | racc (~> 1.4) 77 | parallel (1.26.3) 78 | parser (3.3.7.1) 79 | ast (~> 2.4.1) 80 | racc 81 | pp (0.6.2) 82 | prettyprint 83 | prettyprint (0.2.0) 84 | psych (5.2.3) 85 | date 86 | stringio 87 | racc (1.8.1) 88 | rack (3.1.10) 89 | rack-session (2.1.0) 90 | base64 (>= 0.1.0) 91 | rack (>= 3.0.0) 92 | rack-test (2.2.0) 93 | rack (>= 1.3) 94 | rackup (2.2.1) 95 | rack (>= 3) 96 | rails-dom-testing (2.2.0) 97 | activesupport (>= 5.0.0) 98 | minitest 99 | nokogiri (>= 1.6) 100 | rails-html-sanitizer (1.6.2) 101 | loofah (~> 2.21) 102 | nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) 103 | railties (7.1.4) 104 | actionpack (= 7.1.4) 105 | activesupport (= 7.1.4) 106 | irb 107 | rackup (>= 1.0.0) 108 | rake (>= 12.2) 109 | thor (~> 1.0, >= 1.2.2) 110 | zeitwerk (~> 2.6) 111 | rainbow (3.1.1) 112 | rake (13.2.1) 113 | rdoc (6.12.0) 114 | psych (>= 4.0.0) 115 | regexp_parser (2.10.0) 116 | reline (0.6.0) 117 | io-console (~> 0.5) 118 | rspec (3.13.0) 119 | rspec-core (~> 3.13.0) 120 | rspec-expectations (~> 3.13.0) 121 | rspec-mocks (~> 3.13.0) 122 | rspec-core (3.13.3) 123 | rspec-support (~> 3.13.0) 124 | rspec-expectations (3.13.3) 125 | diff-lcs (>= 1.2.0, < 2.0) 126 | rspec-support (~> 3.13.0) 127 | rspec-mocks (3.13.2) 128 | diff-lcs (>= 1.2.0, < 2.0) 129 | rspec-support (~> 3.13.0) 130 | rspec-support (3.13.2) 131 | rubocop (1.72.0) 132 | json (~> 2.3) 133 | language_server-protocol (~> 3.17.0.2) 134 | lint_roller (~> 1.1.0) 135 | parallel (~> 1.10) 136 | parser (>= 3.3.0.2) 137 | rainbow (>= 2.2.2, < 4.0) 138 | regexp_parser (>= 2.9.3, < 3.0) 139 | rubocop-ast (>= 1.38.0, < 2.0) 140 | ruby-progressbar (~> 1.7) 141 | unicode-display_width (>= 2.4.0, < 4.0) 142 | rubocop-ast (1.38.0) 143 | parser (>= 3.3.1.0) 144 | rubocop-capybara (2.21.0) 145 | rubocop (~> 1.41) 146 | rubocop-factory_bot (2.26.1) 147 | rubocop (~> 1.61) 148 | rubocop-rake (0.6.0) 149 | rubocop (~> 1.0) 150 | rubocop-rspec (2.31.0) 151 | rubocop (~> 1.40) 152 | rubocop-capybara (~> 2.17) 153 | rubocop-factory_bot (~> 2.22) 154 | rubocop-rspec_rails (~> 2.28) 155 | rubocop-rspec_rails (2.29.1) 156 | rubocop (~> 1.61) 157 | ruby-progressbar (1.13.0) 158 | simplecov (0.22.0) 159 | docile (~> 1.1) 160 | simplecov-html (~> 0.11) 161 | simplecov_json_formatter (~> 0.1) 162 | simplecov-html (0.13.1) 163 | simplecov_json_formatter (0.1.4) 164 | stringio (3.1.3) 165 | thor (1.3.2) 166 | timeout (0.4.3) 167 | tzinfo (2.0.6) 168 | concurrent-ruby (~> 1.0) 169 | unicode-display_width (3.1.4) 170 | unicode-emoji (~> 4.0, >= 4.0.4) 171 | unicode-emoji (4.0.4) 172 | zeitwerk (2.7.1) 173 | 174 | PLATFORMS 175 | arm64-darwin 176 | x86_64-darwin 177 | x86_64-linux 178 | 179 | DEPENDENCIES 180 | activerecord (~> 7.1.0) 181 | bundler (~> 2.2) 182 | byebug (~> 11.1) 183 | outrigger! 184 | railties (~> 7.1.0) 185 | rake (~> 13.0) 186 | rspec (~> 3.7) 187 | rubocop (~> 1.20) 188 | rubocop-rake (~> 0.6) 189 | rubocop-rspec (~> 2.4) 190 | simplecov (~> 0.21) 191 | 192 | BUNDLED WITH 193 | 2.4.20 194 | -------------------------------------------------------------------------------- /Gemfile.activerecord-7.2.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | outrigger (3.0.3) 5 | activerecord (>= 6.0, <= 8.0) 6 | railties (>= 6.0, <= 8.0) 7 | 8 | GEM 9 | remote: https://rubygems.org/ 10 | specs: 11 | actionpack (7.2.2.1) 12 | actionview (= 7.2.2.1) 13 | activesupport (= 7.2.2.1) 14 | nokogiri (>= 1.8.5) 15 | racc 16 | rack (>= 2.2.4, < 3.2) 17 | rack-session (>= 1.0.1) 18 | rack-test (>= 0.6.3) 19 | rails-dom-testing (~> 2.2) 20 | rails-html-sanitizer (~> 1.6) 21 | useragent (~> 0.16) 22 | actionview (7.2.2.1) 23 | activesupport (= 7.2.2.1) 24 | builder (~> 3.1) 25 | erubi (~> 1.11) 26 | rails-dom-testing (~> 2.2) 27 | rails-html-sanitizer (~> 1.6) 28 | activemodel (7.2.2.1) 29 | activesupport (= 7.2.2.1) 30 | activerecord (7.2.2.1) 31 | activemodel (= 7.2.2.1) 32 | activesupport (= 7.2.2.1) 33 | timeout (>= 0.4.0) 34 | activesupport (7.2.2.1) 35 | base64 36 | benchmark (>= 0.3) 37 | bigdecimal 38 | concurrent-ruby (~> 1.0, >= 1.3.1) 39 | connection_pool (>= 2.2.5) 40 | drb 41 | i18n (>= 1.6, < 2) 42 | logger (>= 1.4.2) 43 | minitest (>= 5.1) 44 | securerandom (>= 0.3) 45 | tzinfo (~> 2.0, >= 2.0.5) 46 | ast (2.4.2) 47 | base64 (0.2.0) 48 | benchmark (0.4.0) 49 | bigdecimal (3.1.9) 50 | builder (3.3.0) 51 | byebug (11.1.3) 52 | concurrent-ruby (1.3.4) 53 | connection_pool (2.5.0) 54 | crass (1.0.6) 55 | date (3.4.1) 56 | diff-lcs (1.6.0) 57 | docile (1.4.1) 58 | drb (2.2.1) 59 | erubi (1.13.1) 60 | i18n (1.14.7) 61 | concurrent-ruby (~> 1.0) 62 | io-console (0.8.0) 63 | irb (1.15.1) 64 | pp (>= 0.6.0) 65 | rdoc (>= 4.0.0) 66 | reline (>= 0.4.2) 67 | json (2.10.1) 68 | language_server-protocol (3.17.0.4) 69 | lint_roller (1.1.0) 70 | logger (1.6.6) 71 | loofah (2.24.0) 72 | crass (~> 1.0.2) 73 | nokogiri (>= 1.12.0) 74 | minitest (5.25.4) 75 | nokogiri (1.18.2-arm64-darwin) 76 | racc (~> 1.4) 77 | nokogiri (1.18.2-x86_64-darwin) 78 | racc (~> 1.4) 79 | nokogiri (1.18.2-x86_64-linux-gnu) 80 | racc (~> 1.4) 81 | parallel (1.26.3) 82 | parser (3.3.7.1) 83 | ast (~> 2.4.1) 84 | racc 85 | pp (0.6.2) 86 | prettyprint 87 | prettyprint (0.2.0) 88 | psych (5.2.3) 89 | date 90 | stringio 91 | racc (1.8.1) 92 | rack (3.1.10) 93 | rack-session (2.1.0) 94 | base64 (>= 0.1.0) 95 | rack (>= 3.0.0) 96 | rack-test (2.2.0) 97 | rack (>= 1.3) 98 | rackup (2.2.1) 99 | rack (>= 3) 100 | rails-dom-testing (2.2.0) 101 | activesupport (>= 5.0.0) 102 | minitest 103 | nokogiri (>= 1.6) 104 | rails-html-sanitizer (1.6.2) 105 | loofah (~> 2.21) 106 | nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) 107 | railties (7.2.2.1) 108 | actionpack (= 7.2.2.1) 109 | activesupport (= 7.2.2.1) 110 | irb (~> 1.13) 111 | rackup (>= 1.0.0) 112 | rake (>= 12.2) 113 | thor (~> 1.0, >= 1.2.2) 114 | zeitwerk (~> 2.6) 115 | rainbow (3.1.1) 116 | rake (13.2.1) 117 | rdoc (6.12.0) 118 | psych (>= 4.0.0) 119 | regexp_parser (2.10.0) 120 | reline (0.6.0) 121 | io-console (~> 0.5) 122 | rspec (3.13.0) 123 | rspec-core (~> 3.13.0) 124 | rspec-expectations (~> 3.13.0) 125 | rspec-mocks (~> 3.13.0) 126 | rspec-core (3.13.3) 127 | rspec-support (~> 3.13.0) 128 | rspec-expectations (3.13.3) 129 | diff-lcs (>= 1.2.0, < 2.0) 130 | rspec-support (~> 3.13.0) 131 | rspec-mocks (3.13.2) 132 | diff-lcs (>= 1.2.0, < 2.0) 133 | rspec-support (~> 3.13.0) 134 | rspec-support (3.13.2) 135 | rubocop (1.72.0) 136 | json (~> 2.3) 137 | language_server-protocol (~> 3.17.0.2) 138 | lint_roller (~> 1.1.0) 139 | parallel (~> 1.10) 140 | parser (>= 3.3.0.2) 141 | rainbow (>= 2.2.2, < 4.0) 142 | regexp_parser (>= 2.9.3, < 3.0) 143 | rubocop-ast (>= 1.38.0, < 2.0) 144 | ruby-progressbar (~> 1.7) 145 | unicode-display_width (>= 2.4.0, < 4.0) 146 | rubocop-ast (1.38.0) 147 | parser (>= 3.3.1.0) 148 | rubocop-capybara (2.21.0) 149 | rubocop (~> 1.41) 150 | rubocop-factory_bot (2.26.1) 151 | rubocop (~> 1.61) 152 | rubocop-rake (0.6.0) 153 | rubocop (~> 1.0) 154 | rubocop-rspec (2.31.0) 155 | rubocop (~> 1.40) 156 | rubocop-capybara (~> 2.17) 157 | rubocop-factory_bot (~> 2.22) 158 | rubocop-rspec_rails (~> 2.28) 159 | rubocop-rspec_rails (2.29.1) 160 | rubocop (~> 1.61) 161 | ruby-progressbar (1.13.0) 162 | securerandom (0.4.1) 163 | simplecov (0.22.0) 164 | docile (~> 1.1) 165 | simplecov-html (~> 0.11) 166 | simplecov_json_formatter (~> 0.1) 167 | simplecov-html (0.13.1) 168 | simplecov_json_formatter (0.1.4) 169 | stringio (3.1.3) 170 | thor (1.3.2) 171 | timeout (0.4.3) 172 | tzinfo (2.0.6) 173 | concurrent-ruby (~> 1.0) 174 | unicode-display_width (3.1.4) 175 | unicode-emoji (~> 4.0, >= 4.0.4) 176 | unicode-emoji (4.0.4) 177 | useragent (0.16.11) 178 | zeitwerk (2.7.1) 179 | 180 | PLATFORMS 181 | arm64-darwin 182 | x86_64-darwin 183 | x86_64-linux 184 | 185 | DEPENDENCIES 186 | activerecord (~> 7.2.0) 187 | bundler (~> 2.2) 188 | byebug (~> 11.1) 189 | outrigger! 190 | railties (~> 7.2.0) 191 | rake (~> 13.0) 192 | rspec (~> 3.7) 193 | rubocop (~> 1.20) 194 | rubocop-rake (~> 0.6) 195 | rubocop-rspec (~> 2.4) 196 | simplecov (~> 0.21) 197 | 198 | BUNDLED WITH 199 | 2.4.20 200 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | outrigger (3.0.3) 5 | activerecord (>= 6.0, <= 8.0) 6 | railties (>= 6.0, <= 8.0) 7 | 8 | GEM 9 | remote: https://rubygems.org/ 10 | specs: 11 | actionpack (8.0.0) 12 | actionview (= 8.0.0) 13 | activesupport (= 8.0.0) 14 | nokogiri (>= 1.8.5) 15 | rack (>= 2.2.4) 16 | rack-session (>= 1.0.1) 17 | rack-test (>= 0.6.3) 18 | rails-dom-testing (~> 2.2) 19 | rails-html-sanitizer (~> 1.6) 20 | useragent (~> 0.16) 21 | actionview (8.0.0) 22 | activesupport (= 8.0.0) 23 | builder (~> 3.1) 24 | erubi (~> 1.11) 25 | rails-dom-testing (~> 2.2) 26 | rails-html-sanitizer (~> 1.6) 27 | activemodel (8.0.0) 28 | activesupport (= 8.0.0) 29 | activerecord (8.0.0) 30 | activemodel (= 8.0.0) 31 | activesupport (= 8.0.0) 32 | timeout (>= 0.4.0) 33 | activesupport (8.0.0) 34 | base64 35 | benchmark (>= 0.3) 36 | bigdecimal 37 | concurrent-ruby (~> 1.0, >= 1.3.1) 38 | connection_pool (>= 2.2.5) 39 | drb 40 | i18n (>= 1.6, < 2) 41 | logger (>= 1.4.2) 42 | minitest (>= 5.1) 43 | securerandom (>= 0.3) 44 | tzinfo (~> 2.0, >= 2.0.5) 45 | uri (>= 0.13.1) 46 | ast (2.4.2) 47 | base64 (0.2.0) 48 | benchmark (0.4.0) 49 | bigdecimal (3.1.9) 50 | builder (3.3.0) 51 | byebug (11.1.3) 52 | concurrent-ruby (1.3.4) 53 | connection_pool (2.5.0) 54 | crass (1.0.6) 55 | date (3.4.1) 56 | diff-lcs (1.6.0) 57 | docile (1.4.1) 58 | drb (2.2.1) 59 | erubi (1.13.1) 60 | i18n (1.14.7) 61 | concurrent-ruby (~> 1.0) 62 | io-console (0.8.0) 63 | irb (1.15.1) 64 | pp (>= 0.6.0) 65 | rdoc (>= 4.0.0) 66 | reline (>= 0.4.2) 67 | json (2.10.1) 68 | language_server-protocol (3.17.0.4) 69 | lint_roller (1.1.0) 70 | logger (1.6.6) 71 | loofah (2.24.0) 72 | crass (~> 1.0.2) 73 | nokogiri (>= 1.12.0) 74 | minitest (5.25.4) 75 | nokogiri (1.18.2-arm64-darwin) 76 | racc (~> 1.4) 77 | nokogiri (1.18.2-x86_64-darwin) 78 | racc (~> 1.4) 79 | nokogiri (1.18.2-x86_64-linux-gnu) 80 | racc (~> 1.4) 81 | parallel (1.26.3) 82 | parser (3.3.7.1) 83 | ast (~> 2.4.1) 84 | racc 85 | pp (0.6.2) 86 | prettyprint 87 | prettyprint (0.2.0) 88 | psych (5.2.3) 89 | date 90 | stringio 91 | racc (1.8.1) 92 | rack (3.1.10) 93 | rack-session (2.1.0) 94 | base64 (>= 0.1.0) 95 | rack (>= 3.0.0) 96 | rack-test (2.2.0) 97 | rack (>= 1.3) 98 | rackup (2.2.1) 99 | rack (>= 3) 100 | rails-dom-testing (2.2.0) 101 | activesupport (>= 5.0.0) 102 | minitest 103 | nokogiri (>= 1.6) 104 | rails-html-sanitizer (1.6.2) 105 | loofah (~> 2.21) 106 | nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) 107 | railties (8.0.0) 108 | actionpack (= 8.0.0) 109 | activesupport (= 8.0.0) 110 | irb (~> 1.13) 111 | rackup (>= 1.0.0) 112 | rake (>= 12.2) 113 | thor (~> 1.0, >= 1.2.2) 114 | zeitwerk (~> 2.6) 115 | rainbow (3.1.1) 116 | rake (13.2.1) 117 | rdoc (6.12.0) 118 | psych (>= 4.0.0) 119 | regexp_parser (2.10.0) 120 | reline (0.6.0) 121 | io-console (~> 0.5) 122 | rspec (3.13.0) 123 | rspec-core (~> 3.13.0) 124 | rspec-expectations (~> 3.13.0) 125 | rspec-mocks (~> 3.13.0) 126 | rspec-core (3.13.3) 127 | rspec-support (~> 3.13.0) 128 | rspec-expectations (3.13.3) 129 | diff-lcs (>= 1.2.0, < 2.0) 130 | rspec-support (~> 3.13.0) 131 | rspec-mocks (3.13.2) 132 | diff-lcs (>= 1.2.0, < 2.0) 133 | rspec-support (~> 3.13.0) 134 | rspec-support (3.13.2) 135 | rubocop (1.72.0) 136 | json (~> 2.3) 137 | language_server-protocol (~> 3.17.0.2) 138 | lint_roller (~> 1.1.0) 139 | parallel (~> 1.10) 140 | parser (>= 3.3.0.2) 141 | rainbow (>= 2.2.2, < 4.0) 142 | regexp_parser (>= 2.9.3, < 3.0) 143 | rubocop-ast (>= 1.38.0, < 2.0) 144 | ruby-progressbar (~> 1.7) 145 | unicode-display_width (>= 2.4.0, < 4.0) 146 | rubocop-ast (1.38.0) 147 | parser (>= 3.3.1.0) 148 | rubocop-capybara (2.21.0) 149 | rubocop (~> 1.41) 150 | rubocop-factory_bot (2.26.1) 151 | rubocop (~> 1.61) 152 | rubocop-rake (0.6.0) 153 | rubocop (~> 1.0) 154 | rubocop-rspec (2.31.0) 155 | rubocop (~> 1.40) 156 | rubocop-capybara (~> 2.17) 157 | rubocop-factory_bot (~> 2.22) 158 | rubocop-rspec_rails (~> 2.28) 159 | rubocop-rspec_rails (2.29.1) 160 | rubocop (~> 1.61) 161 | ruby-progressbar (1.13.0) 162 | securerandom (0.4.1) 163 | simplecov (0.22.0) 164 | docile (~> 1.1) 165 | simplecov-html (~> 0.11) 166 | simplecov_json_formatter (~> 0.1) 167 | simplecov-html (0.13.1) 168 | simplecov_json_formatter (0.1.4) 169 | stringio (3.1.3) 170 | thor (1.3.2) 171 | timeout (0.4.3) 172 | tzinfo (2.0.6) 173 | concurrent-ruby (~> 1.0) 174 | unicode-display_width (3.1.4) 175 | unicode-emoji (~> 4.0, >= 4.0.4) 176 | unicode-emoji (4.0.4) 177 | uri (1.0.2) 178 | useragent (0.16.11) 179 | zeitwerk (2.7.1) 180 | 181 | PLATFORMS 182 | arm64-darwin 183 | x86_64-darwin 184 | x86_64-linux 185 | 186 | DEPENDENCIES 187 | activerecord (~> 8.0.0) 188 | bundler (~> 2.2) 189 | byebug (~> 11.1) 190 | outrigger! 191 | railties (~> 8.0.0) 192 | rake (~> 13.0) 193 | rspec (~> 3.7) 194 | rubocop (~> 1.20) 195 | rubocop-rake (~> 0.6) 196 | rubocop-rspec (~> 2.4) 197 | simplecov (~> 0.21) 198 | 199 | BUNDLED WITH 200 | 2.4.20 201 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env groovy 2 | 3 | pipeline { 4 | agent { label 'docker' } 5 | 6 | environment { 7 | // Make sure we're ignoring any override files that may be present 8 | COMPOSE_FILE = "docker-compose.yml" 9 | } 10 | 11 | stages { 12 | stage('Test') { 13 | matrix { 14 | agent { label 'docker' } 15 | axes { 16 | axis { 17 | name 'RUBY_VERSION' 18 | values '2.7', '3.0', '3.1', '3.2' 19 | } 20 | axis { 21 | name 'LOCKFILE' 22 | values 'activerecord-6.0', 'activerecord-6.1', 'activerecord-7.0', 'activerecord-7.1', 'activerecord-7.2', 'Gemfile.lock' 23 | } 24 | } 25 | excludes { 26 | exclude { 27 | axis { 28 | name 'RUBY_VERSION' 29 | values '2.7', '3.0', '3.1' 30 | } 31 | axis { 32 | name 'LOCKFILE' 33 | values 'activerecord-7.2', 'Gemfile.lock' 34 | } 35 | } 36 | } 37 | stages { 38 | stage('Build') { 39 | steps { 40 | sh "docker compose build --pull --build-arg RUBY_VERSION=${RUBY_VERSION} --build-arg BUNDLE_LOCKFILE=${LOCKFILE} app" 41 | sh 'docker compose run --rm app rake' 42 | } 43 | } 44 | } 45 | } 46 | } 47 | 48 | stage('Lint') { 49 | steps { 50 | sh "docker compose build --pull --build-arg BUNDLE_LOCKFILE=Gemfile.lock" 51 | sh "docker compose run --rm app bin/rubocop" 52 | } 53 | } 54 | } 55 | 56 | post { 57 | cleanup { 58 | sh 'docker compose down --remove-orphans --rmi all' 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Instructure, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Outrigger 2 | ========== 3 | 4 | [![Build Status](https://travis-ci.org/instructure/outrigger.svg?branch=master)](https://travis-ci.org/instructure/outrigger) 5 | 6 | ### Tag your rails migrations 7 | 8 | Outrigger allows you to tag your migrations so that you can have 9 | complete control. This is especially useful for zero downtime deploys to Production environments. 10 | 11 | Usage 12 | ------------ 13 | 14 | 1. Add `gem outrigger` to your Gemfile and run `bundle install` 15 | 2. Tag migrations like so. 16 | ```ruby 17 | class PreDeployMigration < ActiveRecord::Migration 18 | tag :predeploy 19 | end 20 | class PostDeployMigration < ActiveRecord::Migration 21 | tag :super_fun 22 | end 23 | ``` 24 | 3. Run only the migrations you want. 25 | ``` rake db:migrate:tagged[predeploy] ``` 26 | or 27 | ``` rake db:migrate:tagged[super_fun] ``` 28 | 4. If you need to ensure migrations run in a certain order with regular 29 | `db:migrate`, set up `Outrigger.ordered`. It can be a hash or a proc that 30 | takes a tag; either way it needs to return a sortable value: 31 | ```ruby 32 | Outrigger.ordered = { predeploy: -1, postdeploy: 1 } 33 | ``` 34 | This will run predeploys, untagged migrations (implicitly 0), and then 35 | postdeploy migrations. Migrations with multiple tags will be looked up 36 | by their first tag. 37 | 38 | ### Using with [Switchman](https://github.com/instructure/switchman) 39 | 40 | If your application is also using Switchman to manage multiple shards, you'll 41 | want the `rake db:migrate:tagged` task to run against all shards, not 42 | just the default shard. To do this, add to a rake task file such as 43 | `lib/tasks/myapp.rake`: 44 | 45 | ```ruby 46 | Switchman::Rake.shardify_task('db:migrate:tagged') 47 | ``` 48 | 49 | Multiple Tags 50 | ------------- 51 | 52 | Passing multiple tags to `db:migrate:tagged` means only run migrations that have 53 | all of the given tags. 54 | 55 | ``` rake db:migrate:tagged[predeploy, dynamodb] ``` means run only migrations 56 | tagged with both `predeploy` and `dynamodb`. It will not run migrations tagged 57 | just `predeploy`. 58 | 59 | RuboCop Linter 60 | -------------- 61 | 62 | Outrigger comes with a custom RuboCop linter that you can add to your project, 63 | to verify that all migrations have at least one valid tag. 64 | 65 | Put this into your `.rubocop.yml`. 66 | 67 | ```yaml 68 | require: 69 | - outrigger/cops/migration/tagged 70 | 71 | Migration/Tagged: 72 | Enabled: true 73 | AllowedTags: 74 | - predeploy 75 | - postdeploy 76 | ``` 77 | 78 | Modify `AllowedTags` as necessary. 79 | 80 | ### RuboCop Conflicts 81 | 82 | If you use `rubocop-rails` and have the `Rails/ContentTag` cop enabled, you may 83 | see rubocop errors like the following on your migrations: 84 | ``` 85 | Rails/ContentTag: Use tag.predeploy instead of tag(:predeploy). 86 | tag :predeploy 87 | ^^^^^^^^^^^^^^ 88 | ``` 89 | 90 | This warning is erroneous, as the rails `tag` method is really only relevant in 91 | controllers and views and is not even in scope for migrations. To silence the 92 | warning, add the following to your `.rubocop.yml`: 93 | 94 | ```yaml 95 | Rails/ContentTag: 96 | Exclude: 97 | - "**/db/migrate/*" # this cop is for views, not migrations, where it gets confused with outrigger 98 | ``` 99 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'bundler/gem_tasks' 4 | 5 | begin 6 | require 'rspec/core/rake_task' 7 | 8 | RSpec::Core::RakeTask.new(:spec) 9 | 10 | task(default: :spec) 11 | rescue LoadError 12 | nil 13 | end 14 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'rake' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require 'pathname' 12 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', 13 | Pathname.new(__FILE__).realpath) 14 | 15 | bundle_binstub = File.expand_path('bundle', __dir__) 16 | 17 | if File.file?(bundle_binstub) 18 | if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ 19 | load(bundle_binstub) 20 | else 21 | abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. 22 | Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") 23 | end 24 | end 25 | 26 | require 'rubygems' 27 | require 'bundler/setup' 28 | 29 | load Gem.bin_path('rake', 'rake') 30 | -------------------------------------------------------------------------------- /bin/rspec: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'rspec' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require 'pathname' 12 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', 13 | Pathname.new(__FILE__).realpath) 14 | 15 | bundle_binstub = File.expand_path('bundle', __dir__) 16 | 17 | if File.file?(bundle_binstub) 18 | if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ 19 | load(bundle_binstub) 20 | else 21 | abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. 22 | Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") 23 | end 24 | end 25 | 26 | require 'rubygems' 27 | require 'bundler/setup' 28 | 29 | load Gem.bin_path('rspec-core', 'rspec') 30 | -------------------------------------------------------------------------------- /bin/rubocop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | # 5 | # This file was generated by Bundler. 6 | # 7 | # The application 'rubocop' is installed as part of a gem, and 8 | # this file is here to facilitate running it. 9 | # 10 | 11 | require 'pathname' 12 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', 13 | Pathname.new(__FILE__).realpath) 14 | 15 | bundle_binstub = File.expand_path('bundle', __dir__) 16 | 17 | if File.file?(bundle_binstub) 18 | if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ 19 | load(bundle_binstub) 20 | else 21 | abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. 22 | Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") 23 | end 24 | end 25 | 26 | require 'rubygems' 27 | require 'bundler/setup' 28 | 29 | load Gem.bin_path('rubocop', 'rubocop') 30 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | app: 5 | build: . 6 | environment: 7 | RAILS_ENV: test 8 | 9 | -------------------------------------------------------------------------------- /lib/outrigger.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'active_record' unless defined? ActiveRecord 4 | 5 | require 'outrigger/migrator' 6 | require 'outrigger/taggable' 7 | require 'outrigger/taggable_proxy' 8 | 9 | require 'outrigger/railtie' if defined? Rails::Railtie 10 | 11 | module Outrigger 12 | class << self 13 | attr_accessor :ordered 14 | 15 | def filter(*tags) 16 | tags = tags.flatten.map(&:to_sym) 17 | proc { |migration| (tags - migration.tags).empty? } 18 | end 19 | 20 | def migration_context 21 | if ActiveRecord.version < Gem::Version.new('7.2') 22 | ActiveRecord::Base.connection.migration_context 23 | else 24 | ActiveRecord::Base.connection_pool.migration_context 25 | end 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /lib/outrigger/cops/migration/tagged.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module RuboCop 4 | module Cop 5 | module Migration 6 | class Tagged < Cop 7 | def on_class(node) 8 | _name, _superclass, body = *node 9 | return unless body && migration_class?(node) 10 | 11 | check(node, body) 12 | end 13 | 14 | private 15 | 16 | def_node_matcher :migration_class?, <<~PATTERN 17 | { 18 | (class 19 | (const nil? _) 20 | (const 21 | (const nil? :ActiveRecord) :Migration) ...) 22 | (class 23 | (const nil? _) 24 | (send 25 | (const 26 | (const nil? :ActiveRecord) :Migration) :[] _) ...) 27 | } 28 | PATTERN 29 | 30 | def check(klass, node) 31 | tag = tag_node(node) 32 | 33 | if allowed_tags.empty? 34 | add_offense tag, 35 | location: :expression, 36 | message: 'No allowed tags have been defined in the RuboCop configuration.' 37 | elsif tag 38 | return if allowed_tags.include? tag.children.last.to_a.last 39 | 40 | add_offense tag, 41 | location: :expression, 42 | message: "Tags may only be one of #{allowed_tags}." 43 | else 44 | add_offense klass, 45 | location: :expression, 46 | message: "All migrations require a tag from #{allowed_tags}." 47 | end 48 | end 49 | 50 | def tag_node(node) 51 | node.type == :begin && node.children.compact.find do |n| 52 | n.type == :send && n.to_a[1] == :tag 53 | end 54 | end 55 | 56 | def allowed_tags 57 | cop_config['AllowedTags'].map(&:to_sym) 58 | end 59 | end 60 | end 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /lib/outrigger/migrator.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Outrigger 4 | module Migrator 5 | def runnable 6 | result = super 7 | return result unless Outrigger.ordered 8 | 9 | # re-order according to configuration 10 | result.sort_by! { |m| [Outrigger.ordered[m.tags.first] || 0, m.version] } 11 | result.reverse! if down? 12 | result 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/outrigger/railtie.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Outrigger 4 | class Railtie < Rails::Railtie 5 | railtie_name :taggable_migrations 6 | 7 | rake_tasks do 8 | load 'tasks/outrigger.rake' 9 | end 10 | 11 | initializer 'extend_migrations' do 12 | ActiveSupport.on_load :active_record do 13 | ActiveRecord::Migration.include(Outrigger::Taggable) 14 | ActiveRecord::MigrationProxy.include(Outrigger::TaggableProxy) 15 | ActiveRecord::Migrator.prepend(Outrigger::Migrator) 16 | end 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/outrigger/taggable.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Outrigger 4 | module Taggable 5 | def self.included(base) 6 | base.extend(ClassMethods) 7 | end 8 | 9 | def tags 10 | self.class.tags 11 | end 12 | 13 | module ClassMethods 14 | def tag(*new_tags) 15 | @tags = tags.concat(new_tags).uniq 16 | end 17 | 18 | def tags 19 | @tags ||= [] 20 | end 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /lib/outrigger/taggable_proxy.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Outrigger 4 | module TaggableProxy 5 | def self.included(_body) 6 | delegate :tags, to: :migration 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/outrigger/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Outrigger 4 | VERSION = '3.0.3' 5 | end 6 | -------------------------------------------------------------------------------- /lib/tasks/outrigger.rake: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | namespace :db do 4 | namespace :migrate do 5 | desc 'Run migrations for a Tag' 6 | task tagged: %i[environment load_config] do |_t, args| 7 | puts("Migrating Tags: #{args.extras}") 8 | 9 | Outrigger.migration_context.migrate(nil, &Outrigger.filter(args.extras)) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /outrigger.gemspec: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require_relative 'lib/outrigger/version' 4 | 5 | Gem::Specification.new do |s| 6 | s.name = 'outrigger' 7 | s.version = Outrigger::VERSION 8 | s.authors = ['Drew Bowman'] 9 | s.homepage = 'https://github.com/instructure/outrigger' 10 | s.summary = 'Tag migrations and run them separately' 11 | s.license = 'MIT' 12 | s.description = 'Migrations' 13 | 14 | s.files = Dir.glob('{lib,spec}/**/*') + %w[Rakefile] 15 | s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) } 16 | s.require_paths = ['lib'] 17 | s.metadata['rubygems_mfa_required'] = 'true' 18 | 19 | s.required_ruby_version = '>= 2.6' 20 | 21 | s.add_dependency 'activerecord', '>= 6.0', '<= 8.0' 22 | s.add_dependency 'railties', '>= 6.0', '<= 8.0' 23 | 24 | s.add_development_dependency 'bundler', '~> 2.2' 25 | s.add_development_dependency 'byebug', '~> 11.1' 26 | s.add_development_dependency 'rake', '~> 13.0' 27 | s.add_development_dependency 'rspec', '~> 3.7' 28 | s.add_development_dependency 'rubocop', '~> 1.20' 29 | s.add_development_dependency 'rubocop-rake', '~> 0.6' 30 | s.add_development_dependency 'rubocop-rspec', '~> 2.4' 31 | s.add_development_dependency 'simplecov', '~> 0.21' 32 | end 33 | -------------------------------------------------------------------------------- /spec/outrigger/cops/migration/tagged_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'outrigger/cops/migration/tagged' 4 | 5 | RSpec.describe RuboCop::Cop::Migration::Tagged do # rubocop:disable RSpec/FilePath 6 | let(:config_hash) do 7 | { 8 | 'Migration/Tagged' => { 9 | 'AllowedTags' => %w[predeploy deploy], 10 | 'Enabled' => true 11 | } 12 | } 13 | end 14 | 15 | let(:config) { RuboCop::Config.new(config_hash) } 16 | 17 | let(:migration_class) do 18 | <<~RUBY 19 | class Test < ActiveRecord::Migration[4.2] 20 | tag :predeploy 21 | def change 22 | end 23 | end 24 | RUBY 25 | end 26 | 27 | subject(:cop) { described_class.new(config) } # rubocop:disable RSpec/LeadingSubject 28 | 29 | shared_examples_for 'valid migrations' do 30 | it 'passes valid versioned migration' do 31 | inspect_source(migration_class) 32 | expect(cop.offenses.empty?).to be(true) 33 | end 34 | end 35 | 36 | context 'with valid config' do 37 | include_examples 'valid migrations' 38 | 39 | context 'with missing tags' do 40 | let(:migration_class) do 41 | <<~RUBY 42 | class Test < ActiveRecord::Migration[4.2] 43 | def change 44 | end 45 | end 46 | RUBY 47 | end 48 | 49 | it 'finds missing tag in versioned migration' do 50 | inspect_source(migration_class) 51 | expect(cop.offenses.empty?).to be(false) 52 | expect(cop.offenses.first.message).to match(/All migrations require a tag from/) 53 | end 54 | end 55 | 56 | context 'with invalid tag' do 57 | let(:migration_class) do 58 | <<~RUBY 59 | class Test < ActiveRecord::Migration[4.2] 60 | tag :foobar 61 | def change 62 | end 63 | end 64 | RUBY 65 | end 66 | 67 | it 'fails on invalid tag in versioned migration' do 68 | inspect_source(migration_class) 69 | expect(cop.offenses.empty?).to be(false) 70 | expect(cop.offenses.first.message).to match(/Tags may only be one of/) 71 | end 72 | end 73 | end 74 | 75 | context 'with invalid config' do 76 | let(:config_hash) do 77 | { 78 | 'Migration/Tagged' => { 79 | 'AllowedTags' => [], 80 | 'Enabled' => true 81 | } 82 | } 83 | end 84 | 85 | it 'fails on missing tags in configuration on versioned migration' do 86 | inspect_source(migration_class) 87 | expect(cop.offenses.empty?).to be(false) 88 | expect(cop.offenses.first.message).to match(/No allowed tags have been defined/) 89 | end 90 | end 91 | end 92 | -------------------------------------------------------------------------------- /spec/outrigger/migrator_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module Outrigger 4 | describe Migrator do 5 | around do |example| 6 | Outrigger.ordered = { predeploy: -1, postdeploy: 1 } 7 | example.call 8 | ensure 9 | Outrigger.ordered = nil 10 | end 11 | 12 | let(:migrations) do 13 | [PostDeployMigration.new(nil, 1), UntaggedMigration.new(nil, 2), PreDeployMigration.new(nil, 3), 14 | MultiMigration.new(nil, 4)] 15 | end 16 | 17 | let(:versions) { [] } 18 | let(:direction) { :up } 19 | let(:schema_migration) do 20 | if ActiveRecord.version < Gem::Version.new('7.1') 21 | object_double(ActiveRecord::SchemaMigration, create_table: nil, all_versions: versions) 22 | else 23 | instance_double(ActiveRecord::SchemaMigration, create_table: nil, integer_versions: versions) 24 | end 25 | end 26 | 27 | let(:migrator) do 28 | if ActiveRecord.version < Gem::Version.new('7.1') 29 | ActiveRecord::Migrator.new(direction, migrations, schema_migration) 30 | else 31 | internal_metadata = instance_double(ActiveRecord::InternalMetadata, create_table: nil) 32 | ActiveRecord::Migrator.new(direction, migrations, schema_migration, internal_metadata) 33 | end 34 | end 35 | 36 | before do 37 | allow(ActiveRecord::InternalMetadata).to receive(:create_table) 38 | end 39 | 40 | it 'sorts' do 41 | expect(migrator.runnable.map(&:class)).to eq( 42 | [ 43 | PreDeployMigration, MultiMigration, UntaggedMigration, PostDeployMigration 44 | ] 45 | ) 46 | end 47 | 48 | context 'when going down' do 49 | let(:versions) { [1, 2, 3, 4] } 50 | let(:direction) { :down } 51 | 52 | it 'reverse sorts' do 53 | expect(migrator.runnable.map(&:class)).to eq( 54 | [ 55 | PostDeployMigration, UntaggedMigration, MultiMigration, PreDeployMigration 56 | ] 57 | ) 58 | end 59 | end 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /spec/outrigger/outrigger_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | describe Outrigger do 4 | describe 'filter' do 5 | it 'returns a proc that tests migrations' do 6 | filter = described_class.filter(:predeploy) 7 | 8 | expect(filter.call(PreDeployMigration)).to be(true) 9 | end 10 | 11 | it 'accepts multiple tags' do 12 | filter = described_class.filter(:predeploy, :postdeploy) 13 | 14 | expect(filter.call(MultiMigration)).to be(true) 15 | expect(filter.call(PreDeployMigration)).to be(false) 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /spec/outrigger/railtie_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | describe Outrigger::Railtie do 4 | it 'provides a railtie_name' do 5 | expect(described_class.railtie_name).to eq 'taggable_migrations' 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /spec/outrigger/taggable_proxy_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | class TestProxy 4 | include Outrigger::TaggableProxy 5 | attr_accessor :migration 6 | end 7 | 8 | describe Outrigger::TaggableProxy do 9 | it 'delegates tags to the migration' do 10 | proxy = TestProxy.new 11 | proxy.migration = PreDeployMigration.new 12 | 13 | expect(proxy.tags).to eq([:predeploy]) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/outrigger/taggable_spec.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | describe Outrigger::Taggable do 4 | it 'PreDeployMigration should be predeploy' do 5 | expect(PreDeployMigration.tags).to eq([:predeploy]) 6 | end 7 | 8 | it 'UntaggedMigration should be have no tags' do 9 | expect(UntaggedMigration.tags).to eq([]) 10 | end 11 | 12 | it 'PostDeployMigration should be predeploy' do 13 | expect(PostDeployMigration.tags).to eq([:postdeploy]) 14 | end 15 | 16 | it 'instance tags should point to class tags' do 17 | expect(PreDeployMigration.new.tags).to eq([:predeploy]) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'simplecov' 4 | SimpleCov.start do 5 | add_filter 'lib/outrigger/version.rb' 6 | add_filter 'spec' 7 | track_files 'lib/**/*.rb' 8 | end 9 | SimpleCov.minimum_coverage(85) 10 | 11 | require 'bundler/setup' 12 | require 'byebug' 13 | require 'rails/railtie' 14 | require 'rubocop' 15 | require 'rubocop/rspec/support' 16 | 17 | require 'outrigger' 18 | 19 | ActiveRecord::Migration.include(Outrigger::Taggable) 20 | ActiveRecord::MigrationProxy.include(Outrigger::TaggableProxy) 21 | ActiveRecord::Migrator.prepend(Outrigger::Migrator) 22 | 23 | class PreDeployMigration < ActiveRecord::Migration[5.0] 24 | tag :predeploy 25 | end 26 | 27 | class UntaggedMigration < ActiveRecord::Migration[5.0] 28 | end 29 | 30 | class PostDeployMigration < ActiveRecord::Migration[5.0] 31 | tag :postdeploy 32 | end 33 | 34 | class MultiMigration < ActiveRecord::Migration[5.0] 35 | tag :predeploy, :postdeploy 36 | end 37 | 38 | RSpec.configure do |config| 39 | config.order = 'random' 40 | end 41 | --------------------------------------------------------------------------------