good_migrations 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9dee0175ec6d3a50dfbf5b22591311fb571d718c5f7d5fa56ddaa3e07a95860a
4
- data.tar.gz: 0c483eb30524bbe3a426f197d40dbb7de049db96b8db30d7835ad97f36e23c86
3
+ metadata.gz: e19eb30c1eec98d732644fc373a997608dc6f5433fa7bd4f2c77b5bae9a1a6f5
4
+ data.tar.gz: bcbae2e85f10863533a8efb997ff60c4ad6e3de1b0078a7d59d60b230a4de24a
5
5
  SHA512:
6
- metadata.gz: 91d8a48741dd67c0163e5ad85958f6f623be07d36273aa8df78d94cc55a419bd72498dfb34501b7ecbdfba931ce1a20e3ce16c85c84ddb2b2905e5850152a3a5
7
- data.tar.gz: 55774f660e0aa7b9671dbcf4d734a1266515e37718045ac561ac076d0c9f8ca8a722b0e1c03e88498f848e3db980a7821bef31c298f14bcece1d300b29484b2a
6
+ metadata.gz: 6bf8ccc6aa62b5706559fe7695592e12e5064c0d0fbfd98353d82033ad31b0e2c3b83cc8796adced37fee8af9b3446855b2f075f16239a9672c77124b35a77b6
7
+ data.tar.gz: 2f48ba81878a64a35fa08b356a686a5de0ae0c70dbf643555f2c431929511875d6ede55e374c0b30278ac9a55fa2edce7d4b1fb662fa023b52be2e39f10ede09
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.3.0
4
+ * Minimum supported Ruby version is now 3.1
5
+ * Exclude unnecessary files from the packaged gem
6
+
7
+ ## 0.2.1
8
+
9
+ * Fix Windows paths [#31](https://github.com/testdouble/good-migrations/pull/31)
10
+ by [@MaxLap](https://github.com/MaxLap)
11
+
3
12
  ## 0.2.0
4
13
 
5
14
  * Add `permit_autoloading_before` configuration
data/example/Gemfile CHANGED
@@ -4,8 +4,8 @@ gem "rails", "~> 6.1"
4
4
 
5
5
  gem "good_migrations", path: ".."
6
6
 
7
- gem "sqlite3"
7
+ gem "sqlite3", "~> 1.7.3"
8
8
 
9
- gem "zeitwerk", github: "fxn/zeitwerk"
9
+ gem "zeitwerk", "~> 2.6"
10
10
 
11
11
  gem "bootsnap", require: false
@@ -8,7 +8,7 @@ Bundler.require(:default, Rails.env) if defined?(Bundler)
8
8
 
9
9
  module Example
10
10
  class Application < Rails::Application
11
- if config.respond_to?("eager_load=")
11
+ if config.respond_to?(:eager_load=)
12
12
  config.eager_load = false
13
13
  end
14
14
  # Settings in config/environments/* take precedence over those specified here.
@@ -8,9 +8,10 @@ module GoodMigrations
8
8
  def self.currently_executing
9
9
  migrate_dir_path = Rails.root.join("db/migrate/").to_s
10
10
 
11
- loc = caller.detect { |loc| loc.start_with?(migrate_dir_path) }
12
- return if loc.nil?
13
- new(loc.partition(":").first)
11
+ if (loc = caller.detect { |loc| loc.start_with?(migrate_dir_path) })
12
+ line_number_index = loc.index(":", migrate_dir_path.size)
13
+ new(loc[0...line_number_index])
14
+ end
14
15
  end
15
16
 
16
17
  def associated_time
@@ -1,3 +1,3 @@
1
1
  module GoodMigrations
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: good_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-11-17 00:00:00.000000000 Z
12
+ date: 2024-11-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -116,18 +116,67 @@ email:
116
116
  - kevin.baribeau@gmail.com
117
117
  executables: []
118
118
  extensions: []
119
- extra_rdoc_files: []
119
+ extra_rdoc_files:
120
+ - README.md
121
+ - example/.gitignore
122
+ - example/Gemfile
123
+ - example/README
124
+ - example/Rakefile
125
+ - example/app/assets/config/manifest.js
126
+ - example/app/controllers/application_controller.rb
127
+ - example/app/helpers/application_helper.rb
128
+ - example/app/models/pant.rb
129
+ - example/app/models/shirt.rb
130
+ - example/app/views/layouts/application.html.erb
131
+ - example/bin/rails
132
+ - example/bin/rake
133
+ - example/config.ru
134
+ - example/config/application.rb
135
+ - example/config/boot.rb
136
+ - example/config/database.yml
137
+ - example/config/environment.rb
138
+ - example/config/environments/development.rb
139
+ - example/config/environments/production.rb
140
+ - example/config/environments/test.rb
141
+ - example/config/initializers/backtrace_silencers.rb
142
+ - example/config/initializers/good_migrations.rb
143
+ - example/config/initializers/inflections.rb
144
+ - example/config/initializers/mime_types.rb
145
+ - example/config/initializers/secret_token.rb
146
+ - example/config/initializers/session_store.rb
147
+ - example/config/locales/en.yml
148
+ - example/config/routes.rb
149
+ - example/db/migrate/20160202162849_create_pants.rb
150
+ - example/db/migrate/20160202163803_change_pants.rb
151
+ - example/db/migrate/20160202182520_change_pants_dangerously.rb
152
+ - example/db/migrate/20170101150000_create_shirts.rb
153
+ - example/db/migrate/20170102150000_change_shirts_dangerously.rb
154
+ - example/db/seeds.rb
155
+ - example/doc/README_FOR_APP
156
+ - example/lib/tasks/.gitkeep
157
+ - example/lib/tasks/load_pants.rake
158
+ - example/public/404.html
159
+ - example/public/422.html
160
+ - example/public/500.html
161
+ - example/public/favicon.ico
162
+ - example/public/images/rails.png
163
+ - example/public/index.html
164
+ - example/public/javascripts/application.js
165
+ - example/public/javascripts/controls.js
166
+ - example/public/javascripts/dragdrop.js
167
+ - example/public/javascripts/effects.js
168
+ - example/public/javascripts/prototype.js
169
+ - example/public/javascripts/rails.js
170
+ - example/public/robots.txt
171
+ - example/public/stylesheets/.gitkeep
172
+ - example/script/rails
173
+ - example/test/performance/browsing_test.rb
174
+ - example/test/test_helper.rb
175
+ - example/vendor/plugins/.gitkeep
120
176
  files:
121
- - ".github/workflows/ruby.yml"
122
- - ".gitignore"
123
177
  - CHANGELOG.md
124
- - Gemfile
125
- - Gemfile.lock
126
178
  - LICENSE.txt
127
179
  - README.md
128
- - Rakefile
129
- - bin/console
130
- - bin/setup
131
180
  - example/.gitignore
132
181
  - example/Gemfile
133
182
  - example/README
@@ -183,7 +232,6 @@ files:
183
232
  - example/test/performance/browsing_test.rb
184
233
  - example/test/test_helper.rb
185
234
  - example/vendor/plugins/.gitkeep
186
- - good_migrations.gemspec
187
235
  - lib/good_migrations.rb
188
236
  - lib/good_migrations/configuration.rb
189
237
  - lib/good_migrations/load_error.rb
@@ -193,11 +241,11 @@ files:
193
241
  - lib/good_migrations/railtie.rb
194
242
  - lib/good_migrations/raises_load_error.rb
195
243
  - lib/good_migrations/version.rb
196
- - tasks/good_migrations.rake
197
244
  homepage: https://github.com/testdouble/good-migrations
198
245
  licenses:
199
246
  - MIT
200
- metadata: {}
247
+ metadata:
248
+ rubygems_mfa_required: 'true'
201
249
  post_install_message:
202
250
  rdoc_options: []
203
251
  require_paths:
@@ -206,14 +254,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
206
254
  requirements:
207
255
  - - ">="
208
256
  - !ruby/object:Gem::Version
209
- version: '0'
257
+ version: 3.1.0
210
258
  required_rubygems_version: !ruby/object:Gem::Requirement
211
259
  requirements:
212
260
  - - ">="
213
261
  - !ruby/object:Gem::Version
214
262
  version: '0'
215
263
  requirements: []
216
- rubygems_version: 3.2.22
264
+ rubygems_version: 3.5.11
217
265
  signing_key:
218
266
  specification_version: 4
219
267
  summary: Prevents Rails from auto-loading app code in database migrations
@@ -1,32 +0,0 @@
1
- # This workflow uses actions that are not certified by GitHub.
2
- # They are provided by a third-party and are governed by
3
- # separate terms of service, privacy policy, and support
4
- # documentation.
5
- # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
- # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
-
8
- name: Ruby
9
-
10
- on:
11
- push:
12
- branches: [ main ]
13
- pull_request:
14
- branches: [ main ]
15
-
16
- jobs:
17
- test:
18
-
19
- runs-on: ubuntu-latest
20
- strategy:
21
- matrix:
22
- ruby-version: ['2.7', '3.0']
23
-
24
- steps:
25
- - uses: actions/checkout@v2
26
- - name: Set up Ruby
27
- uses: ruby/setup-ruby@v1
28
- with:
29
- ruby-version: ${{ matrix.ruby-version }}
30
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
31
- - name: Run tests
32
- run: bundle exec rake
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in good_migrations.gemspec
4
- gemspec
data/Gemfile.lock DELETED
@@ -1,113 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- good_migrations (0.2.0)
5
- activerecord (>= 3.1)
6
- railties (>= 3.1)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actionpack (6.1.4.1)
12
- actionview (= 6.1.4.1)
13
- activesupport (= 6.1.4.1)
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.4.1)
19
- activesupport (= 6.1.4.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.1.4.1)
25
- activesupport (= 6.1.4.1)
26
- activerecord (6.1.4.1)
27
- activemodel (= 6.1.4.1)
28
- activesupport (= 6.1.4.1)
29
- activesupport (6.1.4.1)
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.2.4)
37
- coderay (1.1.3)
38
- concurrent-ruby (1.1.9)
39
- crass (1.0.6)
40
- erubi (1.10.0)
41
- i18n (1.8.11)
42
- concurrent-ruby (~> 1.0)
43
- loofah (2.12.0)
44
- crass (~> 1.0.2)
45
- nokogiri (>= 1.5.9)
46
- method_source (1.0.0)
47
- mini_portile2 (2.6.1)
48
- minitest (5.14.4)
49
- nokogiri (1.12.5)
50
- mini_portile2 (~> 2.6.1)
51
- racc (~> 1.4)
52
- parallel (1.20.1)
53
- parser (3.0.1.1)
54
- ast (~> 2.4.1)
55
- pry (0.14.1)
56
- coderay (~> 1.1)
57
- method_source (~> 1.0)
58
- racc (1.6.0)
59
- rack (2.2.3)
60
- rack-test (1.1.0)
61
- rack (>= 1.0, < 3)
62
- rails-dom-testing (2.0.3)
63
- activesupport (>= 4.2.0)
64
- nokogiri (>= 1.6)
65
- rails-html-sanitizer (1.4.2)
66
- loofah (~> 2.3)
67
- railties (6.1.4.1)
68
- actionpack (= 6.1.4.1)
69
- activesupport (= 6.1.4.1)
70
- method_source
71
- rake (>= 0.13)
72
- thor (~> 1.0)
73
- rainbow (3.0.0)
74
- rake (13.0.3)
75
- regexp_parser (2.1.1)
76
- rexml (3.2.5)
77
- rubocop (1.17.0)
78
- parallel (~> 1.10)
79
- parser (>= 3.0.0.0)
80
- rainbow (>= 2.2.2, < 4.0)
81
- regexp_parser (>= 1.8, < 3.0)
82
- rexml
83
- rubocop-ast (>= 1.7.0, < 2.0)
84
- ruby-progressbar (~> 1.7)
85
- unicode-display_width (>= 1.4.0, < 3.0)
86
- rubocop-ast (1.7.0)
87
- parser (>= 3.0.1.1)
88
- rubocop-performance (1.11.2)
89
- rubocop (>= 1.7.0, < 2.0)
90
- rubocop-ast (>= 0.4.0)
91
- ruby-progressbar (1.11.0)
92
- standard (1.1.2)
93
- rubocop (= 1.17.0)
94
- rubocop-performance (= 1.11.2)
95
- thor (1.1.0)
96
- tzinfo (2.0.4)
97
- concurrent-ruby (~> 1.0)
98
- unicode-display_width (2.0.0)
99
- zeitwerk (2.5.1)
100
-
101
- PLATFORMS
102
- ruby
103
-
104
- DEPENDENCIES
105
- bundler
106
- good_migrations!
107
- minitest
108
- pry
109
- rake
110
- standard
111
-
112
- BUNDLED WITH
113
- 2.2.30
data/Rakefile DELETED
@@ -1,11 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
- require "standard/rake"
4
-
5
- Rake::TestTask.new(:test) do |t|
6
- t.libs << "test"
7
- t.libs << "lib"
8
- t.test_files = FileList["test/**/*_test.rb"]
9
- end
10
-
11
- task default: ["standard:fix", :test]
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "good_migrations"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here
@@ -1,29 +0,0 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "good_migrations/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "good_migrations"
7
- spec.version = GoodMigrations::VERSION
8
- spec.authors = ["Justin Searls", "Kevin Baribeau"]
9
- spec.email = ["searls@gmail.com", "kevin.baribeau@gmail.com"]
10
-
11
- spec.summary = "Prevents Rails from auto-loading app code in database migrations"
12
- spec.description = "Referencing code in app/ from a database migration risks breaking the migration when your app code changes; this gem prevents that mistake"
13
- spec.homepage = "https://github.com/testdouble/good-migrations"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = "exe"
18
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_dependency "railties", ">= 3.1"
22
- spec.add_dependency "activerecord", ">= 3.1"
23
-
24
- spec.add_development_dependency "bundler"
25
- spec.add_development_dependency "rake"
26
- spec.add_development_dependency "minitest"
27
- spec.add_development_dependency "pry"
28
- spec.add_development_dependency "standard"
29
- end
@@ -1,18 +0,0 @@
1
- require "active_support/dependencies"
2
- require "good_migrations"
3
-
4
- namespace :good_migrations do
5
- task :disable_autoload do
6
- next if ENV["GOOD_MIGRATIONS"] == "skip"
7
- GoodMigrations::PatchesAutoloader.instance.patch!
8
- end
9
-
10
- task :reenable_autoload do
11
- next if ENV["GOOD_MIGRATIONS"] == "skip"
12
- GoodMigrations::PatchesAutoloader.instance.unpatch!
13
- end
14
- end
15
-
16
- Rake::Task["db:migrate"].enhance(["good_migrations:disable_autoload"]) do
17
- Rake::Task["good_migrations:reenable_autoload"].invoke
18
- end