schema_monkey 2.1.6 → 3.0.2.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/prs.yml +173 -0
  3. data/.gitignore +1 -1
  4. data/.simplecov +20 -0
  5. data/Gemfile +4 -1
  6. data/README.md +26 -15
  7. data/Rakefile +2 -0
  8. data/gemfiles/Gemfile.base +1 -1
  9. data/gemfiles/activerecord-5.2/Gemfile.base +2 -1
  10. data/gemfiles/activerecord-5.2/Gemfile.mysql2 +2 -2
  11. data/gemfiles/activerecord-5.2/Gemfile.postgresql +2 -2
  12. data/gemfiles/activerecord-5.2/Gemfile.sqlite3 +3 -3
  13. data/gemfiles/activerecord-6.0/Gemfile.base +4 -0
  14. data/gemfiles/activerecord-6.0/Gemfile.mysql2 +10 -0
  15. data/gemfiles/activerecord-6.0/Gemfile.postgresql +10 -0
  16. data/gemfiles/{activerecord-4.2 → activerecord-6.0}/Gemfile.sqlite3 +3 -3
  17. data/gemfiles/activerecord-6.1/Gemfile.base +4 -0
  18. data/gemfiles/activerecord-6.1/Gemfile.mysql2 +10 -0
  19. data/gemfiles/activerecord-6.1/Gemfile.postgresql +10 -0
  20. data/gemfiles/{activerecord-5.0 → activerecord-6.1}/Gemfile.sqlite3 +3 -3
  21. data/gemfiles/activerecord-7.0/Gemfile.base +4 -0
  22. data/gemfiles/activerecord-7.0/Gemfile.mysql2 +10 -0
  23. data/gemfiles/activerecord-7.0/Gemfile.postgresql +10 -0
  24. data/gemfiles/{activerecord-5.1 → activerecord-7.0}/Gemfile.sqlite3 +3 -3
  25. data/lib/schema_monkey/active_record.rb +2 -0
  26. data/lib/schema_monkey/client.rb +2 -0
  27. data/lib/schema_monkey/errors.rb +2 -0
  28. data/lib/schema_monkey/module.rb +2 -0
  29. data/lib/schema_monkey/monkey.rb +2 -0
  30. data/lib/schema_monkey/stack.rb +2 -0
  31. data/lib/schema_monkey/version.rb +3 -1
  32. data/lib/schema_monkey.rb +3 -1
  33. data/schema_dev.yml +11 -8
  34. data/schema_monkey.gemspec +8 -9
  35. data/spec/active_record_spec.rb +2 -0
  36. data/spec/connection_spec.rb +2 -0
  37. data/spec/middleware_spec.rb +5 -3
  38. data/spec/module_spec.rb +2 -0
  39. data/spec/schema_monkey_spec.rb +5 -3
  40. data/spec/spec_helper.rb +13 -6
  41. metadata +27 -68
  42. data/.travis.yml +0 -27
  43. data/gemfiles/activerecord-4.2/Gemfile.base +0 -3
  44. data/gemfiles/activerecord-4.2/Gemfile.mysql2 +0 -10
  45. data/gemfiles/activerecord-4.2/Gemfile.postgresql +0 -10
  46. data/gemfiles/activerecord-5.0/Gemfile.base +0 -3
  47. data/gemfiles/activerecord-5.0/Gemfile.mysql2 +0 -10
  48. data/gemfiles/activerecord-5.0/Gemfile.postgresql +0 -10
  49. data/gemfiles/activerecord-5.1/Gemfile.base +0 -3
  50. data/gemfiles/activerecord-5.1/Gemfile.mysql2 +0 -10
  51. data/gemfiles/activerecord-5.1/Gemfile.postgresql +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e72d1832f0372062ca33b717a482d10516dc4460611013349d63fbae4ea2a8a8
4
- data.tar.gz: 7e10e59d22a47907534aec2a8dc5da4ef652ded6e3576632205725a82b66fe56
3
+ metadata.gz: 86494a57b56623929a861997a0c44a3754ebca960251b82fab7011ae17e6ec50
4
+ data.tar.gz: aeafc058895eaede8ead68488b347fef3526edd9016675f160c14f1819593472
5
5
  SHA512:
6
- metadata.gz: 5892789299af8e8ae364932970dc51546d260ae79edefd0b1d713d17c37257e286b353528c2b751972325a5164f2a04177e9d94f322e2bf367fafeff48f4a4a2
7
- data.tar.gz: b2d15105d0d275b5eca5befb7cfe0401c949f35f1bc37c8647a176746f5f77654213ec73668f34366c0260d2efebcee960b7a7e4549b3bb5c82163a49a7503de
6
+ metadata.gz: 0e9b6ff3977a2f4337dae47d7a5c4f58a867813ba6330707297f7fe36adf89e571fb49310937329b0fa14807d6b57cbc885afeb273a1666de2aca262f2562076
7
+ data.tar.gz: a5cd2f5526617dc58f35f4b5d315629165aad7e6f42430b14a23de74f2a119bf1e4b17d50d8f2267fa451bb5199f3611283941f3b3d2b15493ff586319440bac
@@ -0,0 +1,173 @@
1
+ # This file was auto-generated by the schema_dev tool, based on the data in
2
+ # ./schema_dev.yml
3
+ # Please do not edit this file; any changes will be overwritten next time
4
+ # schema_dev gets run.
5
+ ---
6
+ name: CI PR Builds
7
+ 'on':
8
+ push:
9
+ branches:
10
+ - master
11
+ pull_request:
12
+ concurrency:
13
+ group: ci-${{ github.ref }}
14
+ cancel-in-progress: true
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ ruby:
22
+ - '2.5'
23
+ - '2.7'
24
+ - '3.0'
25
+ - '3.1'
26
+ activerecord:
27
+ - '5.2'
28
+ - '6.0'
29
+ - '6.1'
30
+ - '7.0'
31
+ db:
32
+ - mysql2
33
+ - sqlite3
34
+ - skip
35
+ dbversion:
36
+ - skip
37
+ exclude:
38
+ - ruby: '3.0'
39
+ activerecord: '5.2'
40
+ - ruby: '3.1'
41
+ activerecord: '5.2'
42
+ - ruby: '2.5'
43
+ activerecord: '7.0'
44
+ - db: skip
45
+ dbversion: skip
46
+ include:
47
+ - ruby: '2.5'
48
+ activerecord: '5.2'
49
+ db: postgresql
50
+ dbversion: '9.6'
51
+ - ruby: '2.5'
52
+ activerecord: '6.0'
53
+ db: postgresql
54
+ dbversion: '9.6'
55
+ - ruby: '2.5'
56
+ activerecord: '6.1'
57
+ db: postgresql
58
+ dbversion: '9.6'
59
+ - ruby: '2.7'
60
+ activerecord: '5.2'
61
+ db: postgresql
62
+ dbversion: '9.6'
63
+ - ruby: '2.7'
64
+ activerecord: '6.0'
65
+ db: postgresql
66
+ dbversion: '9.6'
67
+ - ruby: '2.7'
68
+ activerecord: '6.1'
69
+ db: postgresql
70
+ dbversion: '9.6'
71
+ - ruby: '2.7'
72
+ activerecord: '7.0'
73
+ db: postgresql
74
+ dbversion: '9.6'
75
+ - ruby: '3.0'
76
+ activerecord: '6.0'
77
+ db: postgresql
78
+ dbversion: '9.6'
79
+ - ruby: '3.0'
80
+ activerecord: '6.1'
81
+ db: postgresql
82
+ dbversion: '9.6'
83
+ - ruby: '3.0'
84
+ activerecord: '7.0'
85
+ db: postgresql
86
+ dbversion: '9.6'
87
+ - ruby: '3.1'
88
+ activerecord: '6.0'
89
+ db: postgresql
90
+ dbversion: '9.6'
91
+ - ruby: '3.1'
92
+ activerecord: '6.1'
93
+ db: postgresql
94
+ dbversion: '9.6'
95
+ - ruby: '3.1'
96
+ activerecord: '7.0'
97
+ db: postgresql
98
+ dbversion: '9.6'
99
+ env:
100
+ BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
101
+ MYSQL_DB_HOST: 127.0.0.1
102
+ MYSQL_DB_USER: root
103
+ MYSQL_DB_PASS: database
104
+ POSTGRESQL_DB_HOST: 127.0.0.1
105
+ POSTGRESQL_DB_USER: schema_plus_test
106
+ POSTGRESQL_DB_PASS: database
107
+ steps:
108
+ - uses: actions/checkout@v2
109
+ - name: Set up Ruby
110
+ uses: ruby/setup-ruby@v1
111
+ with:
112
+ ruby-version: "${{ matrix.ruby }}"
113
+ bundler-cache: true
114
+ - name: Run bundle update
115
+ run: bundle update
116
+ - name: Start Mysql
117
+ if: matrix.db == 'mysql2'
118
+ run: |
119
+ docker run --rm --detach \
120
+ -e MYSQL_ROOT_PASSWORD=$MYSQL_DB_PASS \
121
+ -p 3306:3306 \
122
+ --health-cmd "mysqladmin ping --host=127.0.0.1 --password=$MYSQL_DB_PASS --silent" \
123
+ --health-interval 5s \
124
+ --health-timeout 5s \
125
+ --health-retries 5 \
126
+ --name database mysql:5.6
127
+ - name: Start Postgresql
128
+ if: matrix.db == 'postgresql'
129
+ run: |
130
+ docker run --rm --detach \
131
+ -e POSTGRES_USER=$POSTGRESQL_DB_USER \
132
+ -e POSTGRES_PASSWORD=$POSTGRESQL_DB_PASS \
133
+ -p 5432:5432 \
134
+ --health-cmd "pg_isready -q" \
135
+ --health-interval 5s \
136
+ --health-timeout 5s \
137
+ --health-retries 5 \
138
+ --name database postgres:${{ matrix.dbversion }}
139
+ - name: Wait for database to start
140
+ if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
141
+ run: |
142
+ COUNT=0
143
+ ATTEMPTS=20
144
+ until [[ $COUNT -eq $ATTEMPTS ]]; do
145
+ [ "$(docker inspect -f {{.State.Health.Status}} database)" == "healthy" ] && break
146
+ echo $(( COUNT++ )) > /dev/null
147
+ sleep 2
148
+ done
149
+ - name: Create testing database
150
+ if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
151
+ run: bundle exec rake create_ci_database
152
+ - name: Run tests
153
+ run: bundle exec rake spec
154
+ - name: Shutdown database
155
+ if: always() && (matrix.db == 'postgresql' || matrix.db == 'mysql2')
156
+ run: docker stop database
157
+ - name: Coveralls Parallel
158
+ if: "${{ !env.ACT }}"
159
+ uses: coverallsapp/github-action@master
160
+ with:
161
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
162
+ flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}
163
+ parallel: true
164
+ finish:
165
+ needs: test
166
+ runs-on: ubuntu-latest
167
+ steps:
168
+ - name: Coveralls Finished
169
+ if: "${{ !env.ACT }}"
170
+ uses: coverallsapp/github-action@master
171
+ with:
172
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
173
+ parallel-finished: true
data/.gitignore CHANGED
@@ -1,7 +1,7 @@
1
1
  /coverage
2
2
  /tmp
3
3
  /pkg
4
- Gemfile.local
4
+ /Gemfile.local
5
5
 
6
6
  *.lock
7
7
  *.log
data/.simplecov ADDED
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ SimpleCov.configure do
4
+ enable_coverage :branch
5
+ add_filter '/spec/'
6
+
7
+ add_group 'Binaries', '/bin/'
8
+ add_group 'Libraries', '/lib/'
9
+
10
+ if ENV['CI']
11
+ require 'simplecov-lcov'
12
+
13
+ SimpleCov::Formatter::LcovFormatter.config do |c|
14
+ c.report_with_single_file = true
15
+ c.single_report_path = 'coverage/lcov.info'
16
+ end
17
+
18
+ formatter SimpleCov::Formatter::LcovFormatter
19
+ end
20
+ end
data/Gemfile CHANGED
@@ -1,5 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "http://rubygems.org"
2
4
 
3
5
  gemspec
4
6
 
5
- File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local
7
+ gemfile_local = File.expand_path '../Gemfile.local', __FILE__
8
+ eval File.read(gemfile_local), binding, gemfile_local if File.exist? gemfile_local
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/schema_monkey.svg)](http://badge.fury.io/rb/schema_monkey)
2
- [![Build Status](https://secure.travis-ci.org/SchemaPlus/schema_monkey.svg)](http://travis-ci.org/SchemaPlus/schema_monkey)
2
+ [![Build Status](https://github.com/SchemaPlus/schema_monkey/actions/workflows/prs.yml/badge.svg)](https://github.com/SchemaPlus/schema_monkey/actions)
3
3
  [![Coverage Status](https://img.shields.io/coveralls/SchemaPlus/schema_monkey.svg)](https://coveralls.io/r/SchemaPlus/schema_monkey)
4
- [![Dependency Status](https://gemnasium.com/lomba/schema_monkey.svg)](https://gemnasium.com/SchemaPlus/schema_monkey)
5
4
 
6
5
  # SchemaMonkey
7
6
 
@@ -227,21 +226,34 @@ SchemaMonkey is tested on:
227
226
 
228
227
  <!-- SCHEMA_DEV: MATRIX - begin -->
229
228
  <!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->
230
- * ruby **2.3.1** with activerecord **4.2**, using **mysql2**, **sqlite3** or **postgresql**
231
- * ruby **2.3.1** with activerecord **5.0**, using **mysql2**, **sqlite3** or **postgresql**
232
- * ruby **2.3.1** with activerecord **5.1**, using **mysql2**, **sqlite3** or **postgresql**
233
- * ruby **2.3.1** with activerecord **5.2**, using **mysql2**, **sqlite3** or **postgresql**
229
+ * ruby **2.5** with activerecord **5.2**, using **mysql2**, **sqlite3** or **postgresql:9.6**
230
+ * ruby **2.5** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
231
+ * ruby **2.5** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
232
+ * ruby **2.7** with activerecord **5.2**, using **mysql2**, **sqlite3** or **postgresql:9.6**
233
+ * ruby **2.7** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
234
+ * ruby **2.7** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
235
+ * ruby **2.7** with activerecord **7.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
236
+ * ruby **3.0** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
237
+ * ruby **3.0** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
238
+ * ruby **3.0** with activerecord **7.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
239
+ * ruby **3.1** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
240
+ * ruby **3.1** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
241
+ * ruby **3.1** with activerecord **7.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
234
242
 
235
243
  <!-- SCHEMA_DEV: MATRIX - end -->
236
244
 
237
245
  ## Release Notes
238
- * 2.1.6 -- stricter dependency on modware
239
- * 2.1.5 -- Remove dependency on its-it :( #12
240
- * 2.1.4 -- Loosen dependency to allow AR 5.0, and include it in the test matrix
241
- * 2.1.3 -- Guard against multiple insertion of modules.
242
- * 2.1.2 -- Insert self earlier; don't wait for connection adapter to be instantiated. Fixes #6 re `db:schema:load`
243
- * 2.1.1 -- Bug fix: don't choke if a module contains a BasicObject const
244
- * 2.1.0 -- First version to support all of schema_plus's needs for the 1.8.7 -> 2.0 upgrade
246
+
247
+ * **3.0.2** -- Add AR 7.0 and Ruby 3.1
248
+ * **3.0.1** -- Use modware 1.0.1
249
+ * **3.0.0** -- updated to support ruby 2.5+ only and rails 5.2 through 6.1
250
+ * **2.1.6** -- stricter dependency on modware
251
+ * **2.1.5** -- Remove dependency on its-it :( #12
252
+ * **2.1.4** -- Loosen dependency to allow AR 5.0, and include it in the test matrix
253
+ * **2.1.3** -- Guard against multiple insertion of modules.
254
+ * **2.1.2** -- Insert self earlier; don't wait for connection adapter to be instantiated. Fixes #6 re `db:schema:load`
255
+ * **2.1.1** -- Bug fix: don't choke if a module contains a BasicObject const
256
+ * **2.1.0** -- First version to support all of schema_plus's needs for the 1.8.7 -> 2.0 upgrade
245
257
 
246
258
 
247
259
  ## Development & Testing
@@ -256,7 +268,7 @@ Some things to know about to help you develop and test:
256
268
  * **schema_dev**: SchemaMonkey uses [schema_dev](https://github.com/SchemaPlus/schema_dev) to
257
269
  facilitate running rspec tests on the matrix of ruby, activerecord, and database
258
270
  versions that the gem supports, both locally and on
259
- [travis-ci](http://travis-ci.org/SchemaPlus/schema_monkey)
271
+ [github actions](https://github.com/SchemaPlus/schema_monkey/actions)
260
272
 
261
273
  To to run rspec locally on the full matrix, do:
262
274
 
@@ -268,5 +280,4 @@ Some things to know about to help you develop and test:
268
280
  The matrix of configurations is specified in `schema_dev.yml` in
269
281
  the project root.
270
282
 
271
-
272
283
  <!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_DEV - end -->
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
  Bundler::GemHelper.install_tasks
3
5
 
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
- gemspec :path => File.expand_path('..', __FILE__)
2
+ gemspec path: File.expand_path('..', __FILE__)
3
3
 
4
4
  File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local
@@ -1,3 +1,4 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
2
3
 
3
4
  gem "activerecord", ">= 5.2.0.beta0", "< 5.3"
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "mysql2"
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "pg"
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "sqlite3"
@@ -7,4 +7,4 @@ end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
- end
10
+ end
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 6.0", "< 6.1"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "sqlite3"
@@ -7,4 +7,4 @@ end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
- end
10
+ end
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 6.1", "< 6.2"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "sqlite3"
@@ -7,4 +7,4 @@ end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
- end
10
+ end
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 7.0", "< 7.1"
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -1,5 +1,5 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
1
+ base_gemfile = File.expand_path('../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile), binding, base_gemfile
3
3
 
4
4
  platform :ruby do
5
5
  gem "sqlite3"
@@ -7,4 +7,4 @@ end
7
7
 
8
8
  platform :jruby do
9
9
  gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
- end
10
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaMonkey
2
4
  module ActiveRecord
3
5
  module ConnectionAdapters
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaMonkey
2
4
  class Client
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaMonkey
2
4
  class MiddlewareError < Exception
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaMonkey
2
4
  module Module
3
5
  extend self
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaMonkey
2
4
 
3
5
  # The main manager for the monkey patches. Singleton instance
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaMonkey
2
4
  module Stack
3
5
  def self.insert(path, mod)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SchemaMonkey
2
- VERSION = "2.1.6"
4
+ VERSION = "3.0.2.beta.1"
3
5
  end
data/lib/schema_monkey.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_record'
2
4
  require 'active_support/core_ext/string'
3
5
  require 'modware'
@@ -30,7 +32,7 @@ module SchemaMonkey
30
32
  end
31
33
 
32
34
  def self.insert(opts={})
33
- monkey.insert(opts)
35
+ monkey.insert(**opts)
34
36
  end
35
37
 
36
38
  private
data/schema_dev.yml CHANGED
@@ -1,11 +1,14 @@
1
1
  ruby:
2
- - 2.3.1
2
+ - 2.5
3
+ - 2.7
4
+ - 3.0
5
+ - 3.1
3
6
  activerecord:
4
- - 4.2
5
- - 5.0
6
- - 5.1
7
- - 5.2
7
+ - 5.2
8
+ - 6.0
9
+ - 6.1
10
+ - 7.0
8
11
  db:
9
- - mysql2
10
- - sqlite3
11
- - postgresql
12
+ - mysql2
13
+ - sqlite3
14
+ - postgresql
@@ -1,4 +1,5 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'schema_monkey/version'
@@ -18,16 +19,14 @@ Gem::Specification.new do |spec|
18
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
20
  spec.require_paths = ["lib"]
20
21
 
21
- spec.required_ruby_version = ">= 2.1.0"
22
- spec.add_dependency "activerecord", ">= 4.2"
23
- spec.add_dependency "modware", "~> 0.1.0"
22
+ spec.required_ruby_version = ">= 2.5.0"
23
+
24
+ spec.add_dependency "activerecord", ">= 5.2"
25
+ spec.add_dependency "modware", "~> 1.0.2"
24
26
 
25
27
  spec.add_development_dependency "bundler"
26
- spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "rake", "~> 13.0"
27
29
  spec.add_development_dependency "rspec", "~> 3.0"
28
30
  spec.add_development_dependency "rspec-given", "~> 3.6"
29
- spec.add_development_dependency "its-it"
30
- spec.add_development_dependency "schema_dev", "~> 3.7"
31
- spec.add_development_dependency "simplecov"
32
- spec.add_development_dependency "simplecov-gem-profile"
31
+ spec.add_development_dependency "schema_dev", "~> 4.2.beta.1"
33
32
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  $client_count = 0
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Connection" do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe SchemaMonkey::Middleware do
@@ -12,7 +14,7 @@ describe SchemaMonkey::Middleware do
12
14
 
13
15
  context "when start with inline implementation" do
14
16
 
15
- When(:env) { SchemaMonkey::Middleware::Group::Stack.start result: [] { |env| env.result << :inline } }
17
+ When(:env) { SchemaMonkey::Middleware::Group::Stack.start(result: []) { |env| env.result << :inline } }
16
18
 
17
19
  Then { expect(env.result).to eq [:inline] }
18
20
 
@@ -55,7 +57,7 @@ describe SchemaMonkey::Middleware do
55
57
 
56
58
 
57
59
  def make_definition
58
- Module.new.tap(&it.module_eval(<<-END))
60
+ Module.new.tap {|e| e.module_eval(<<-END) }
59
61
  module Middleware
60
62
  module Group
61
63
  module Stack
@@ -67,7 +69,7 @@ describe SchemaMonkey::Middleware do
67
69
  end
68
70
 
69
71
  def make_client(n)
70
- Module.new.tap(&it.module_eval(<<-END))
72
+ Module.new.tap {|e| e.module_eval(<<-END) }
71
73
  module Middleware
72
74
  module Group
73
75
  module Stack
data/spec/module_spec.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe SchemaMonkey::Module do
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe SchemaMonkey do
4
6
 
5
7
  it "doesn't register same client's middleware twice" do
6
- base = Module.new.tap(&it.module_eval(<<-END))
8
+ base = Module.new.tap { |e| e.module_eval(<<-END) }
7
9
  module Middleware
8
10
  module Group
9
11
  module Stack
@@ -12,7 +14,7 @@ describe SchemaMonkey do
12
14
  end
13
15
  end
14
16
  END
15
- mod = Module.new.tap(&it.module_eval(<<-END))
17
+ mod = Module.new.tap { |e| e.module_eval(<<-END) }
16
18
  module Middleware
17
19
  module Group
18
20
  module Stack
@@ -33,7 +35,7 @@ describe SchemaMonkey do
33
35
  end
34
36
 
35
37
  it "doesn't register same client's ActiveRecord extensions twice" do
36
- mod = Module.new.tap(&it.module_eval(<<-END))
38
+ mod = Module.new.tap{ |e| e.module_eval(<<-END) }
37
39
  module ActiveRecord
38
40
  module Base
39
41
  def monkey_test
data/spec/spec_helper.rb CHANGED
@@ -1,19 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'simplecov'
2
- require 'simplecov-gem-profile'
3
- SimpleCov.start "gem" do
4
- add_filter "/tasks/"
5
- end
4
+ SimpleCov.start
6
5
 
7
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
8
7
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
9
8
 
10
9
  require 'rspec'
11
10
  require 'rspec/given'
12
- require 'its-it'
13
11
  require 'active_record'
14
12
  require 'schema_monkey'
15
13
  require 'schema_dev/rspec'
16
14
 
15
+ def create_database
16
+ config = SchemaDev::Rspec.db_configuration
17
+
18
+ return if config['host'].nil?
19
+
20
+ ActiveRecord::Tasks::DatabaseTasks.create(config)
21
+ end
22
+
23
+ create_database
24
+
17
25
  SchemaDev::Rspec.setup
18
26
 
19
27
  Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
@@ -26,4 +34,3 @@ RSpec.configure do |config|
26
34
  end
27
35
 
28
36
  SimpleCov.command_name "[ruby #{RUBY_VERSION} - ActiveRecord #{::ActiveRecord::VERSION::STRING} - #{ActiveRecord::Base.connection.adapter_name}]"
29
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_monkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.6
4
+ version: 3.0.2.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-13 00:00:00.000000000 Z
11
+ date: 2022-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: '5.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.2'
26
+ version: '5.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: modware
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.0
33
+ version: 1.0.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.0
40
+ version: 1.0.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -94,62 +94,20 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.6'
97
- - !ruby/object:Gem::Dependency
98
- name: its-it
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: schema_dev
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - "~>"
116
102
  - !ruby/object:Gem::Version
117
- version: '3.7'
103
+ version: 4.2.beta.1
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
108
  - - "~>"
123
109
  - !ruby/object:Gem::Version
124
- version: '3.7'
125
- - !ruby/object:Gem::Dependency
126
- name: simplecov
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: simplecov-gem-profile
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
110
+ version: 4.2.beta.1
153
111
  description: Provides a module insertion protocol to facilitate adding features to
154
112
  ActiveRecord
155
113
  email:
@@ -158,29 +116,30 @@ executables: []
158
116
  extensions: []
159
117
  extra_rdoc_files: []
160
118
  files:
119
+ - ".github/workflows/prs.yml"
161
120
  - ".gitignore"
162
- - ".travis.yml"
121
+ - ".simplecov"
163
122
  - Gemfile
164
123
  - LICENSE.txt
165
124
  - README.md
166
125
  - Rakefile
167
126
  - gemfiles/Gemfile.base
168
- - gemfiles/activerecord-4.2/Gemfile.base
169
- - gemfiles/activerecord-4.2/Gemfile.mysql2
170
- - gemfiles/activerecord-4.2/Gemfile.postgresql
171
- - gemfiles/activerecord-4.2/Gemfile.sqlite3
172
- - gemfiles/activerecord-5.0/Gemfile.base
173
- - gemfiles/activerecord-5.0/Gemfile.mysql2
174
- - gemfiles/activerecord-5.0/Gemfile.postgresql
175
- - gemfiles/activerecord-5.0/Gemfile.sqlite3
176
- - gemfiles/activerecord-5.1/Gemfile.base
177
- - gemfiles/activerecord-5.1/Gemfile.mysql2
178
- - gemfiles/activerecord-5.1/Gemfile.postgresql
179
- - gemfiles/activerecord-5.1/Gemfile.sqlite3
180
127
  - gemfiles/activerecord-5.2/Gemfile.base
181
128
  - gemfiles/activerecord-5.2/Gemfile.mysql2
182
129
  - gemfiles/activerecord-5.2/Gemfile.postgresql
183
130
  - gemfiles/activerecord-5.2/Gemfile.sqlite3
131
+ - gemfiles/activerecord-6.0/Gemfile.base
132
+ - gemfiles/activerecord-6.0/Gemfile.mysql2
133
+ - gemfiles/activerecord-6.0/Gemfile.postgresql
134
+ - gemfiles/activerecord-6.0/Gemfile.sqlite3
135
+ - gemfiles/activerecord-6.1/Gemfile.base
136
+ - gemfiles/activerecord-6.1/Gemfile.mysql2
137
+ - gemfiles/activerecord-6.1/Gemfile.postgresql
138
+ - gemfiles/activerecord-6.1/Gemfile.sqlite3
139
+ - gemfiles/activerecord-7.0/Gemfile.base
140
+ - gemfiles/activerecord-7.0/Gemfile.mysql2
141
+ - gemfiles/activerecord-7.0/Gemfile.postgresql
142
+ - gemfiles/activerecord-7.0/Gemfile.sqlite3
184
143
  - lib/schema_monkey.rb
185
144
  - lib/schema_monkey/active_record.rb
186
145
  - lib/schema_monkey/client.rb
@@ -209,12 +168,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
168
  requirements:
210
169
  - - ">="
211
170
  - !ruby/object:Gem::Version
212
- version: 2.1.0
171
+ version: 2.5.0
213
172
  required_rubygems_version: !ruby/object:Gem::Requirement
214
173
  requirements:
215
- - - ">="
174
+ - - ">"
216
175
  - !ruby/object:Gem::Version
217
- version: '0'
176
+ version: 1.3.1
218
177
  requirements: []
219
178
  rubygems_version: 3.0.8
220
179
  signing_key:
data/.travis.yml DELETED
@@ -1,27 +0,0 @@
1
- # This file was auto-generated by the schema_dev tool, based on the data in
2
- # ./schema_dev.yml
3
- # Please do not edit this file; any changes will be overwritten next time
4
- # schema_dev gets run.
5
- ---
6
- sudo: false
7
- rvm:
8
- - 2.3.1
9
- gemfile:
10
- - gemfiles/activerecord-4.2/Gemfile.mysql2
11
- - gemfiles/activerecord-4.2/Gemfile.postgresql
12
- - gemfiles/activerecord-4.2/Gemfile.sqlite3
13
- - gemfiles/activerecord-5.0/Gemfile.mysql2
14
- - gemfiles/activerecord-5.0/Gemfile.postgresql
15
- - gemfiles/activerecord-5.0/Gemfile.sqlite3
16
- - gemfiles/activerecord-5.1/Gemfile.mysql2
17
- - gemfiles/activerecord-5.1/Gemfile.postgresql
18
- - gemfiles/activerecord-5.1/Gemfile.sqlite3
19
- - gemfiles/activerecord-5.2/Gemfile.mysql2
20
- - gemfiles/activerecord-5.2/Gemfile.postgresql
21
- - gemfiles/activerecord-5.2/Gemfile.sqlite3
22
- env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
23
- addons:
24
- postgresql: '9.4'
25
- before_script: bundle exec rake create_databases
26
- after_script: bundle exec rake drop_databases
27
- script: bundle exec rake travis
@@ -1,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "activerecord", "~> 4.2.6"
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "mysql2", '>= 0.3.18', '< 0.5'
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcmysql-adapter'
10
- end
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "pg", "< 1"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end
@@ -1,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "activerecord", "~> 5.0.1"
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "mysql2"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcmysql-adapter'
10
- end
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "pg", "< 1"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end
@@ -1,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "activerecord", "~> 5.1.0"
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "mysql2"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcmysql-adapter'
10
- end
@@ -1,10 +0,0 @@
1
- require "pathname"
2
- eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
-
4
- platform :ruby do
5
- gem "pg", "< 1"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end