schema_monkey 2.1.4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/prs.yml +147 -0
  3. data/.gitignore +1 -1
  4. data/.simplecov +18 -0
  5. data/Gemfile +2 -1
  6. data/README.md +16 -9
  7. data/gemfiles/Gemfile.base +1 -1
  8. data/gemfiles/activerecord-5.2/Gemfile.base +4 -0
  9. data/gemfiles/activerecord-5.2/Gemfile.mysql2 +10 -0
  10. data/gemfiles/activerecord-5.2/Gemfile.postgresql +10 -0
  11. data/gemfiles/{activerecord-4.2 → activerecord-5.2}/Gemfile.sqlite3 +3 -3
  12. data/gemfiles/activerecord-6.0/Gemfile.base +4 -0
  13. data/gemfiles/activerecord-6.0/Gemfile.mysql2 +10 -0
  14. data/gemfiles/activerecord-6.0/Gemfile.postgresql +10 -0
  15. data/gemfiles/{activerecord-5.0 → activerecord-6.0}/Gemfile.sqlite3 +3 -3
  16. data/gemfiles/activerecord-6.1/Gemfile.base +4 -0
  17. data/gemfiles/activerecord-6.1/Gemfile.mysql2 +10 -0
  18. data/gemfiles/activerecord-6.1/Gemfile.postgresql +10 -0
  19. data/gemfiles/activerecord-6.1/Gemfile.sqlite3 +10 -0
  20. data/lib/schema_monkey/client.rb +3 -3
  21. data/lib/schema_monkey/module.rb +1 -1
  22. data/lib/schema_monkey/monkey.rb +1 -1
  23. data/lib/schema_monkey/version.rb +1 -1
  24. data/lib/schema_monkey.rb +1 -2
  25. data/schema_dev.yml +9 -11
  26. data/schema_monkey.gemspec +7 -9
  27. data/spec/middleware_spec.rb +3 -3
  28. data/spec/schema_monkey_spec.rb +3 -3
  29. data/spec/spec_helper.rb +11 -5
  30. metadata +33 -71
  31. data/.travis.yml +0 -33
  32. data/gemfiles/activerecord-4.2/Gemfile.base +0 -3
  33. data/gemfiles/activerecord-4.2/Gemfile.mysql2 +0 -10
  34. data/gemfiles/activerecord-4.2/Gemfile.postgresql +0 -10
  35. data/gemfiles/activerecord-5.0/Gemfile.base +0 -3
  36. data/gemfiles/activerecord-5.0/Gemfile.mysql2 +0 -10
  37. data/gemfiles/activerecord-5.0/Gemfile.postgresql +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 56b443f53b18f1a6664d45246336164ee69f6727
4
- data.tar.gz: da045381e4b36a03af0852a606a3be218aa92a02
2
+ SHA256:
3
+ metadata.gz: d5822f51e038f56d22a8cb867f67d117b6f28493a4e560638a87711180374a3d
4
+ data.tar.gz: 0f259502c998ed15df18b4d77b8578e0a2cef2840e48cd5b7fb38af9392943fc
5
5
  SHA512:
6
- metadata.gz: 090634decedc9626bf389ef26bf5f4faa843aa0084310c9f2ab404820f725e9b944abb235a7289f61bd79811987489f55872ec2264746ba9b30a691411da7aa4
7
- data.tar.gz: 4a54fc56c121a0b72eca7f171e6c914d50be95750c88860e745e0ab23a1f6773092dad7edc7de1561eddabbbcb74aeb6ca9be0ffd14f3fd4a2b17a71369d99d2
6
+ metadata.gz: 357bc8b0bad0662ca0386b6d17df93e9929a143199f686f106b96947669d0002f1c5bfb8ea5f1a5a2ef18d095fe36fa4472bc7fa4778659169e481caea881eda
7
+ data.tar.gz: 13dc44805c8a765ce364aaba400387e9b9112b1fe889cf0f05ee874027ef4222b583b1cc4bfa5268d55ca839421b0f65991d706a60d518497117a4b30ef2760b
@@ -0,0 +1,147 @@
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
+ activerecord:
26
+ - '5.2'
27
+ - '6.0'
28
+ - '6.1'
29
+ db:
30
+ - mysql2
31
+ - sqlite3
32
+ - skip
33
+ dbversion:
34
+ - skip
35
+ exclude:
36
+ - ruby: '3.0'
37
+ activerecord: '5.2'
38
+ - db: skip
39
+ dbversion: skip
40
+ include:
41
+ - ruby: '2.5'
42
+ activerecord: '5.2'
43
+ db: postgresql
44
+ dbversion: '9.6'
45
+ - ruby: '2.5'
46
+ activerecord: '6.0'
47
+ db: postgresql
48
+ dbversion: '9.6'
49
+ - ruby: '2.5'
50
+ activerecord: '6.1'
51
+ db: postgresql
52
+ dbversion: '9.6'
53
+ - ruby: '2.7'
54
+ activerecord: '5.2'
55
+ db: postgresql
56
+ dbversion: '9.6'
57
+ - ruby: '2.7'
58
+ activerecord: '6.0'
59
+ db: postgresql
60
+ dbversion: '9.6'
61
+ - ruby: '2.7'
62
+ activerecord: '6.1'
63
+ db: postgresql
64
+ dbversion: '9.6'
65
+ - ruby: '3.0'
66
+ activerecord: '6.0'
67
+ db: postgresql
68
+ dbversion: '9.6'
69
+ - ruby: '3.0'
70
+ activerecord: '6.1'
71
+ db: postgresql
72
+ dbversion: '9.6'
73
+ env:
74
+ BUNDLE_GEMFILE: "${{ github.workspace }}/gemfiles/activerecord-${{ matrix.activerecord }}/Gemfile.${{ matrix.db }}"
75
+ MYSQL_DB_HOST: 127.0.0.1
76
+ MYSQL_DB_USER: root
77
+ MYSQL_DB_PASS: database
78
+ POSTGRESQL_DB_HOST: 127.0.0.1
79
+ POSTGRESQL_DB_USER: schema_plus_test
80
+ POSTGRESQL_DB_PASS: database
81
+ steps:
82
+ - uses: actions/checkout@v2
83
+ - name: Set up Ruby
84
+ uses: ruby/setup-ruby@v1
85
+ with:
86
+ ruby-version: "${{ matrix.ruby }}"
87
+ bundler-cache: true
88
+ - name: Run bundle update
89
+ run: bundle update
90
+ - name: Start Mysql
91
+ if: matrix.db == 'mysql2'
92
+ run: |
93
+ docker run --rm --detach \
94
+ -e MYSQL_ROOT_PASSWORD=$MYSQL_DB_PASS \
95
+ -p 3306:3306 \
96
+ --health-cmd "mysqladmin ping --host=127.0.0.1 --password=$MYSQL_DB_PASS --silent" \
97
+ --health-interval 5s \
98
+ --health-timeout 5s \
99
+ --health-retries 5 \
100
+ --name database mysql:5.6
101
+ - name: Start Postgresql
102
+ if: matrix.db == 'postgresql'
103
+ run: |
104
+ docker run --rm --detach \
105
+ -e POSTGRES_USER=$POSTGRESQL_DB_USER \
106
+ -e POSTGRES_PASSWORD=$POSTGRESQL_DB_PASS \
107
+ -p 5432:5432 \
108
+ --health-cmd "pg_isready -q" \
109
+ --health-interval 5s \
110
+ --health-timeout 5s \
111
+ --health-retries 5 \
112
+ --name database postgres:${{ matrix.dbversion }}
113
+ - name: Wait for database to start
114
+ if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
115
+ run: |
116
+ COUNT=0
117
+ ATTEMPTS=20
118
+ until [[ $COUNT -eq $ATTEMPTS ]]; do
119
+ [ "$(docker inspect -f {{.State.Health.Status}} database)" == "healthy" ] && break
120
+ echo $(( COUNT++ )) > /dev/null
121
+ sleep 2
122
+ done
123
+ - name: Create testing database
124
+ if: "(matrix.db == 'postgresql' || matrix.db == 'mysql2')"
125
+ run: bundle exec rake create_ci_database
126
+ - name: Run tests
127
+ run: bundle exec rake spec
128
+ - name: Shutdown database
129
+ if: always() && (matrix.db == 'postgresql' || matrix.db == 'mysql2')
130
+ run: docker stop database
131
+ - name: Coveralls Parallel
132
+ if: "${{ !env.ACT }}"
133
+ uses: coverallsapp/github-action@master
134
+ with:
135
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
136
+ flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}-${{ matrix.db }}-${{ matrix.dbversion }}
137
+ parallel: true
138
+ finish:
139
+ needs: test
140
+ runs-on: ubuntu-latest
141
+ steps:
142
+ - name: Coveralls Finished
143
+ if: "${{ !env.ACT }}"
144
+ uses: coverallsapp/github-action@master
145
+ with:
146
+ github-token: "${{ secrets.GITHUB_TOKEN }}"
147
+ 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,18 @@
1
+ SimpleCov.configure do
2
+ enable_coverage :branch
3
+ add_filter '/spec/'
4
+
5
+ add_group 'Binaries', '/bin/'
6
+ add_group 'Libraries', '/lib/'
7
+
8
+ if ENV['CI']
9
+ require 'simplecov-lcov'
10
+
11
+ SimpleCov::Formatter::LcovFormatter.config do |c|
12
+ c.report_with_single_file = true
13
+ c.single_report_path = 'coverage/lcov.info'
14
+ end
15
+
16
+ formatter SimpleCov::Formatter::LcovFormatter
17
+ end
18
+ end
data/Gemfile CHANGED
@@ -2,4 +2,5 @@ source "http://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- File.exist?(gemfile_local = File.expand_path('../Gemfile.local', __FILE__)) and eval File.read(gemfile_local), binding, gemfile_local
5
+ gemfile_local = File.expand_path '../Gemfile.local', __FILE__
6
+ 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
 
@@ -80,7 +79,7 @@ module PracticalJoker
80
79
  module Base
81
80
 
82
81
  def save(*args)
83
- raise "April Fools!" if Time.now.yday == 31
82
+ raise "April Fools!" if Time.now.yday == 91
84
83
  super
85
84
  end
86
85
 
@@ -214,7 +213,7 @@ end
214
213
  SchemaMonkey.register(UColumnImpliesUnique)
215
214
  ```
216
215
 
217
- SchemaMonkey uses the module `MyLaterClient::Middleware::Index::Exists` as [modware](https://github.com/ronen/modware) middleware for the corresponding stack. The middleware module can define middleware methods `before`, `arround`, `after`, or `implementation` as per [modware](https://github.com/ronen/modware)
216
+ SchemaMonkey uses the module `MyLaterClient::Middleware::Index::Exists` as [modware](https://github.com/ronen/modware) middleware for the corresponding stack. The middleware module can define middleware methods `before`, `around`, `after`, or `implement` as per [modware](https://github.com/ronen/modware)
218
217
 
219
218
  Note that the distinguishing feature between defining and using a stack is whether `Env` is defined.
220
219
 
@@ -227,13 +226,22 @@ 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.1.5** with activerecord **4.2**, using **mysql2**, **sqlite3** or **postgresql**
231
- * ruby **2.3.0** with activerecord **4.2**, using **mysql2**, **sqlite3** or **postgresql**
232
- * ruby **2.3.0** with activerecord **5.0**, 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 **3.0** with activerecord **6.0**, using **mysql2**, **sqlite3** or **postgresql:9.6**
236
+ * ruby **3.0** with activerecord **6.1**, using **mysql2**, **sqlite3** or **postgresql:9.6**
233
237
 
234
238
  <!-- SCHEMA_DEV: MATRIX - end -->
235
239
 
236
240
  ## Release Notes
241
+
242
+ * 3.0.0 -- updated to support ruby 2.5+ only and rails 5.2 through 6.1
243
+ * 2.1.6 -- stricter dependency on modware
244
+ * 2.1.5 -- Remove dependency on its-it :( #12
237
245
  * 2.1.4 -- Loosen dependency to allow AR 5.0, and include it in the test matrix
238
246
  * 2.1.3 -- Guard against multiple insertion of modules.
239
247
  * 2.1.2 -- Insert self earlier; don't wait for connection adapter to be instantiated. Fixes #6 re `db:schema:load`
@@ -253,7 +261,7 @@ Some things to know about to help you develop and test:
253
261
  * **schema_dev**: SchemaMonkey uses [schema_dev](https://github.com/SchemaPlus/schema_dev) to
254
262
  facilitate running rspec tests on the matrix of ruby, activerecord, and database
255
263
  versions that the gem supports, both locally and on
256
- [travis-ci](http://travis-ci.org/SchemaPlus/schema_monkey)
264
+ [github actions](https://github.com/SchemaPlus/schema_monkey/actions)
257
265
 
258
266
  To to run rspec locally on the full matrix, do:
259
267
 
@@ -265,5 +273,4 @@ Some things to know about to help you develop and test:
265
273
  The matrix of configurations is specified in `schema_dev.yml` in
266
274
  the project root.
267
275
 
268
-
269
276
  <!-- SCHEMA_DEV: TEMPLATE USES SCHEMA_DEV - end -->
@@ -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
@@ -0,0 +1,4 @@
1
+ base_gemfile = File.expand_path('../../Gemfile.base', __FILE__)
2
+ eval File.read(base_gemfile)
3
+
4
+ gem "activerecord", ">= 5.2.0.beta0", "< 5.3"
@@ -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.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
@@ -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 "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
@@ -35,7 +35,7 @@ module SchemaMonkey
35
35
  path = mod.to_s.sub(/^#{@root}::#{base}::/, '')
36
36
  if dbm
37
37
  path = path.split('::')
38
- if (i = path.find_index(&it =~ /\b#{dbm}\b/i)) # delete first occurence
38
+ if (i = path.find_index { |it| it =~ /\b#{dbm}\b/i }) # delete first occurence
39
39
  path.delete_at i
40
40
  end
41
41
  path = path.join('::').gsub(/#{dbm}/i, dbm.to_s) # canonicalize case for things like PostgreSQLAdapter
@@ -56,8 +56,8 @@ module SchemaMonkey
56
56
 
57
57
  modules = []
58
58
  modules += Module.descendants(container, can_load: accept)
59
- modules.select!(&it.to_s =~ accept) if accept
60
- modules.reject!(&it.to_s =~ reject) if reject
59
+ modules.select! { |it| it.to_s =~ accept } if accept
60
+ modules.reject! { |it| it.to_s =~ reject } if reject
61
61
  modules
62
62
  end
63
63
 
@@ -27,7 +27,7 @@ module SchemaMonkey
27
27
  def descendants(mod, can_load: nil)
28
28
  consts, auto = mod.constants.group_by{|c| !!mod.autoload?(c)}.values_at(false, true)
29
29
  consts ||= []
30
- consts += auto.select &it.to_s =~ can_load if can_load and auto
30
+ consts += auto.select { |it| it.to_s =~ can_load } if can_load and auto
31
31
  children = consts.map{|c| mod.const_get(c) }.select { |obj|
32
32
  obj.is_a?(::Module) rescue nil
33
33
  }
@@ -21,7 +21,7 @@ module SchemaMonkey
21
21
 
22
22
  def insert(dbm: nil)
23
23
  insert if dbm and not @inserted # first do all non-dbm-specific insertions
24
- @client_map.values.each &it.insert(dbm: dbm)
24
+ @client_map.values.each { |it| it.insert(dbm: dbm) }
25
25
  @inserted = true
26
26
  @inserted_dbm = dbm if dbm
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module SchemaMonkey
2
- VERSION = "2.1.4"
2
+ VERSION = "3.0.0"
3
3
  end
data/lib/schema_monkey.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'active_record'
2
2
  require 'active_support/core_ext/string'
3
- require 'its-it'
4
3
  require 'modware'
5
4
 
6
5
  require_relative "schema_monkey/active_record"
@@ -31,7 +30,7 @@ module SchemaMonkey
31
30
  end
32
31
 
33
32
  def self.insert(opts={})
34
- monkey.insert(opts)
33
+ monkey.insert(**opts)
35
34
  end
36
35
 
37
36
  private
data/schema_dev.yml CHANGED
@@ -1,14 +1,12 @@
1
1
  ruby:
2
- - 2.1.5
3
- - 2.3.0
2
+ - 2.5
3
+ - 2.7
4
+ - 3.0
4
5
  activerecord:
5
- - 4.2
6
- - 5.0
6
+ - 5.2
7
+ - 6.0
8
+ - 6.1
7
9
  db:
8
- - mysql2
9
- - sqlite3
10
- - postgresql
11
- exclude:
12
- -
13
- ruby: 2.1.5
14
- activerecord: 5.0
10
+ - mysql2
11
+ - sqlite3
12
+ - postgresql
@@ -18,16 +18,14 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.required_ruby_version = ">= 2.1.0"
22
- spec.add_dependency "activerecord", ">= 4.2"
23
- spec.add_dependency "its-it"
24
- spec.add_dependency "modware", "~> 0.1"
21
+ spec.required_ruby_version = ">= 2.5.0"
25
22
 
26
- spec.add_development_dependency "bundler", "~> 1.7"
27
- spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_dependency "activerecord", ">= 5.2"
24
+ spec.add_dependency "modware", "~> 1.0.0"
25
+
26
+ spec.add_development_dependency "bundler"
27
+ spec.add_development_dependency "rake", "~> 13.0"
28
28
  spec.add_development_dependency "rspec", "~> 3.0"
29
29
  spec.add_development_dependency "rspec-given", "~> 3.6"
30
- spec.add_development_dependency "schema_dev", "~> 3.7"
31
- spec.add_development_dependency "simplecov"
32
- spec.add_development_dependency "simplecov-gem-profile"
30
+ spec.add_development_dependency "schema_dev", "~> 4.1"
33
31
  end
@@ -12,7 +12,7 @@ describe SchemaMonkey::Middleware do
12
12
 
13
13
  context "when start with inline implementation" do
14
14
 
15
- When(:env) { SchemaMonkey::Middleware::Group::Stack.start result: [] { |env| env.result << :inline } }
15
+ When(:env) { SchemaMonkey::Middleware::Group::Stack.start(result: []) { |env| env.result << :inline } }
16
16
 
17
17
  Then { expect(env.result).to eq [:inline] }
18
18
 
@@ -55,7 +55,7 @@ describe SchemaMonkey::Middleware do
55
55
 
56
56
 
57
57
  def make_definition
58
- Module.new.tap(&it.module_eval(<<-END))
58
+ Module.new.tap {|e| e.module_eval(<<-END) }
59
59
  module Middleware
60
60
  module Group
61
61
  module Stack
@@ -67,7 +67,7 @@ describe SchemaMonkey::Middleware do
67
67
  end
68
68
 
69
69
  def make_client(n)
70
- Module.new.tap(&it.module_eval(<<-END))
70
+ Module.new.tap {|e| e.module_eval(<<-END) }
71
71
  module Middleware
72
72
  module Group
73
73
  module Stack
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe SchemaMonkey do
4
4
 
5
5
  it "doesn't register same client's middleware twice" do
6
- base = Module.new.tap(&it.module_eval(<<-END))
6
+ base = Module.new.tap { |e| e.module_eval(<<-END) }
7
7
  module Middleware
8
8
  module Group
9
9
  module Stack
@@ -12,7 +12,7 @@ describe SchemaMonkey do
12
12
  end
13
13
  end
14
14
  END
15
- mod = Module.new.tap(&it.module_eval(<<-END))
15
+ mod = Module.new.tap { |e| e.module_eval(<<-END) }
16
16
  module Middleware
17
17
  module Group
18
18
  module Stack
@@ -33,7 +33,7 @@ describe SchemaMonkey do
33
33
  end
34
34
 
35
35
  it "doesn't register same client's ActiveRecord extensions twice" do
36
- mod = Module.new.tap(&it.module_eval(<<-END))
36
+ mod = Module.new.tap{ |e| e.module_eval(<<-END) }
37
37
  module ActiveRecord
38
38
  module Base
39
39
  def monkey_test
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,5 @@
1
1
  require 'simplecov'
2
- require 'simplecov-gem-profile'
3
- SimpleCov.start "gem" do
4
- add_filter "/tasks/"
5
- end
2
+ SimpleCov.start
6
3
 
7
4
  $LOAD_PATH.unshift(File.dirname(__FILE__))
8
5
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
@@ -13,6 +10,16 @@ require 'active_record'
13
10
  require 'schema_monkey'
14
11
  require 'schema_dev/rspec'
15
12
 
13
+ def create_database
14
+ config = SchemaDev::Rspec.db_configuration
15
+
16
+ return if config['host'].nil?
17
+
18
+ ActiveRecord::Tasks::DatabaseTasks.create(config)
19
+ end
20
+
21
+ create_database
22
+
16
23
  SchemaDev::Rspec.setup
17
24
 
18
25
  Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
@@ -25,4 +32,3 @@ RSpec.configure do |config|
25
32
  end
26
33
 
27
34
  SimpleCov.command_name "[ruby #{RUBY_VERSION} - ActiveRecord #{::ActiveRecord::VERSION::STRING} - #{ActiveRecord::Base.connection.adapter_name}]"
28
-
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.4
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-19 00:00:00.000000000 Z
11
+ date: 2022-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,70 +16,56 @@ 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'
27
- - !ruby/object:Gem::Dependency
28
- name: its-it
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
26
+ version: '5.2'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: modware
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '0.1'
33
+ version: 1.0.0
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: '0.1'
40
+ version: 1.0.0
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: bundler
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
- - - "~>"
45
+ - - ">="
60
46
  - !ruby/object:Gem::Version
61
- version: '1.7'
47
+ version: '0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
- - - "~>"
52
+ - - ">="
67
53
  - !ruby/object:Gem::Version
68
- version: '1.7'
54
+ version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rake
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: '10.0'
61
+ version: '13.0'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: '10.0'
68
+ version: '13.0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rspec
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -114,42 +100,14 @@ dependencies:
114
100
  requirements:
115
101
  - - "~>"
116
102
  - !ruby/object:Gem::Version
117
- version: '3.7'
103
+ version: '4.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.1'
153
111
  description: Provides a module insertion protocol to facilitate adding features to
154
112
  ActiveRecord
155
113
  email:
@@ -158,21 +116,26 @@ 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
127
+ - gemfiles/activerecord-5.2/Gemfile.base
128
+ - gemfiles/activerecord-5.2/Gemfile.mysql2
129
+ - gemfiles/activerecord-5.2/Gemfile.postgresql
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
176
139
  - lib/schema_monkey.rb
177
140
  - lib/schema_monkey/active_record.rb
178
141
  - lib/schema_monkey/client.rb
@@ -193,7 +156,7 @@ homepage: https://github.com/SchemaPlus/schema_monkey
193
156
  licenses:
194
157
  - MIT
195
158
  metadata: {}
196
- post_install_message:
159
+ post_install_message:
197
160
  rdoc_options: []
198
161
  require_paths:
199
162
  - lib
@@ -201,16 +164,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
201
164
  requirements:
202
165
  - - ">="
203
166
  - !ruby/object:Gem::Version
204
- version: 2.1.0
167
+ version: 2.5.0
205
168
  required_rubygems_version: !ruby/object:Gem::Requirement
206
169
  requirements:
207
170
  - - ">="
208
171
  - !ruby/object:Gem::Version
209
172
  version: '0'
210
173
  requirements: []
211
- rubyforge_project:
212
- rubygems_version: 2.2.2
213
- signing_key:
174
+ rubygems_version: 3.0.8
175
+ signing_key:
214
176
  specification_version: 4
215
177
  summary: Provides a module insertion protocol to facilitate adding features to ActiveRecord
216
178
  test_files:
data/.travis.yml DELETED
@@ -1,33 +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.1.5
9
- - 2.3.0
10
- gemfile:
11
- - gemfiles/activerecord-4.2/Gemfile.mysql2
12
- - gemfiles/activerecord-4.2/Gemfile.postgresql
13
- - gemfiles/activerecord-4.2/Gemfile.sqlite3
14
- - gemfiles/activerecord-5.0/Gemfile.mysql2
15
- - gemfiles/activerecord-5.0/Gemfile.postgresql
16
- - gemfiles/activerecord-5.0/Gemfile.sqlite3
17
- env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
18
- addons:
19
- postgresql: '9.4'
20
- before_script: bundle exec rake create_databases
21
- after_script: bundle exec rake drop_databases
22
- script: bundle exec rake travis
23
- matrix:
24
- exclude:
25
- - rvm: 2.1.5
26
- gemfile: gemfiles/activerecord-5.0/Gemfile.mysql2
27
- env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
28
- - rvm: 2.1.5
29
- gemfile: gemfiles/activerecord-5.0/Gemfile.postgresql
30
- env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
31
- - rvm: 2.1.5
32
- gemfile: gemfiles/activerecord-5.0/Gemfile.sqlite3
33
- env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=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"
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.0.beta1", "< 5.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"
6
- end
7
-
8
- platform :jruby do
9
- gem 'activerecord-jdbcpostgresql-adapter'
10
- end