with_model 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb3f231c15ce48cb075bcb5fe28ffde183e3432328d7a3797744cef9a9eb27ab
4
- data.tar.gz: 1a4ef223a3c590833eaa4886bf471dd0b1e5fe5f79b84b2ed011537812e681d6
3
+ metadata.gz: e4ed561f9b11dd6fa697e64e755713b9adbb026906705d2b49d8c64baee3c4cb
4
+ data.tar.gz: 2b19575e7778eb877e6360ea70f7df226ac5bb68c3a4a09301c30f4b1ab52832
5
5
  SHA512:
6
- metadata.gz: 21640ee3c2312f019aa6c83268c6606c96f3fe03b7c1af2be15e2fd2ea9a48e3ed31f48d0581733a65577843cdf7069523b674137650d50187d933f8cb53ef90
7
- data.tar.gz: 39aa2e361858be2e75375c02ba272bd39ff2528650b17e6ce197ac92683b3dbf83f0cb968573af37cf60945b847992091e2510f3bde196ba3e7543928f081dc2
6
+ metadata.gz: 4bf97623882743ad61633cab3d8edfd1276fc736ec5b3e1cc0d37557bd59579418417b2c027d8d8dd62883b68767fda5c3269d7b8e26c4a0947712b60ebd1014
7
+ data.tar.gz: dcd6dcdd5a23f592af59aef2f51b5d72eef9b4054d6417854511e885e3046b1778d0715bad11c60bfa48cf3ff1829f27b880b5a48c9ad8a88999b5c6881054fa
@@ -3,7 +3,7 @@ inherit_gem:
3
3
  - default.yml
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 2.3
6
+ TargetRubyVersion: 2.4
7
7
 
8
8
  Lint/MissingCopEnableDirective:
9
9
  Enabled: false
@@ -1,22 +1,20 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
 
3
4
  rvm:
5
+ - 2.7.0
4
6
  - 2.6.5
5
7
  - 2.5.7
6
8
  - 2.4.9
7
- - jruby-9.2.8.0
8
-
9
- install:
10
- - gem install bundler
11
- - bundle install --retry=3
9
+ - jruby-9.2.9.0
12
10
 
13
11
  env:
14
- - ACTIVE_RECORD_BRANCH="master"
15
- - ACTIVE_RECORD_VERSION="~> 6.0.0"
16
- - ACTIVE_RECORD_VERSION="~> 5.2.0"
17
- - ACTIVE_RECORD_VERSION="~> 5.1.0"
18
- - ACTIVE_RECORD_VERSION="~> 5.0.0"
19
- - ACTIVE_RECORD_VERSION="~> 4.2.0"
12
+ global:
13
+ - CC_TEST_REPORTER_ID=fe5c8a8b1b951a54707c08b6fb2a9a5edf9e0522d28bccc648454f774c9ccab1
14
+ matrix:
15
+ - ACTIVE_RECORD_BRANCH="master"
16
+ - ACTIVE_RECORD_VERSION="~> 6.0.0"
17
+ - ACTIVE_RECORD_VERSION="~> 5.2.0"
20
18
 
21
19
  matrix:
22
20
  fast_finish: true
@@ -27,9 +25,14 @@ matrix:
27
25
  env: ACTIVE_RECORD_BRANCH="master"
28
26
  - rvm: 2.4.9
29
27
  env: ACTIVE_RECORD_VERSION="~> 6.0.0"
30
- - rvm: jruby-9.2.8.0
31
- env: ACTIVE_RECORD_VERSION="~> 4.2.0"
32
28
 
33
- addons:
34
- code_climate:
35
- repo_token: fe5c8a8b1b951a54707c08b6fb2a9a5edf9e0522d28bccc648454f774c9ccab1
29
+ before_install:
30
+ - gem install bundler
31
+
32
+ before_script:
33
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
34
+ - chmod +x ./cc-test-reporter
35
+ - ./cc-test-reporter before-build
36
+
37
+ after_script:
38
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
@@ -1,3 +1,9 @@
1
+ ### 2.1.4
2
+
3
+ - Remove deprecation warnings for Ruby 2.7
4
+ - Require Ruby 2.4 or later
5
+ - Require Active Record 5.2 or later
6
+
1
7
  ### 2.1.3
2
8
 
3
9
  - Support ActiveRecord 6.0, working around new dependency tracking API
data/README.md CHANGED
@@ -170,8 +170,8 @@ See the [gemspec metadata](https://rubygems.org/gems/with_model) for dependency
170
170
  - A user-supplied table name is used for tables generated via `with_table`/`WithModel::Table.new`. This may cause collisions at runtime if tests are run concurrently against a single database schema, unless the caller takes care to ensure the table names passed as arguments are unique across threads/processes.
171
171
  - Generated models are created in stubbed constants, which are global; no guarantee is made to the uniqueness of a constant, and this may be unsafe.
172
172
  - Generated classes are ActiveRecord subclasses:
173
- - This library makes no guarantee is made as to the thread-safety of creating ActiveRecord subclasses concurrently.
174
- - This library makes no guarantee is made as to the thread-safety of cleaning up ActiveRecord/ActiveSupport’s internals which are polluted upon class creation.
173
+ - This library makes no guarantee as to the thread-safety of creating ActiveRecord subclasses concurrently.
174
+ - This library makes no guarantee as to the thread-safety of cleaning up ActiveRecord/ActiveSupport’s internals which are polluted upon class creation.
175
175
 
176
176
  In general, `with_model` is not guaranteed to be thread-safe, but is, in certain usages, safe to use concurrently across multiple processes with a single database schema.
177
177
 
@@ -11,7 +11,7 @@ module WithModel
11
11
  # @param options Passed to {WithModel::Model#initialize}.
12
12
  # @param block Yielded an instance of {WithModel::Model::DSL}.
13
13
  def with_model(name, scope: nil, **options, &block)
14
- model = Model.new name, options
14
+ model = Model.new name, **options
15
15
  dsl = Model::DSL.new model
16
16
  dsl.instance_exec(&block) if block
17
17
 
@@ -20,7 +20,7 @@ module WithModel
20
20
  # it already exists.
21
21
  def create
22
22
  connection.drop_table(@name) if exists?
23
- connection.create_table(@name, @options, &@block)
23
+ connection.create_table(@name, **@options, &@block)
24
24
  end
25
25
 
26
26
  def destroy
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WithModel
4
- VERSION = '2.1.3'
4
+ VERSION = '2.1.4'
5
5
  end
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler'
4
- Bundler.setup
3
+ require 'simplecov'
4
+ SimpleCov.start
5
5
 
6
+ require 'bundler/setup'
6
7
  require 'with_model'
8
+
7
9
  RSpec.configure do |config|
8
10
  config.extend WithModel
9
11
 
@@ -18,14 +18,15 @@ 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.3'
21
+ spec.required_ruby_version = '>= 2.4'
22
22
 
23
- spec.add_dependency 'activerecord', '>= 4.2', '< 6.1'
23
+ spec.add_dependency 'activerecord', '>= 5.2', '< 6.1'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 2.0'
26
26
  spec.add_development_dependency 'minitest'
27
27
  spec.add_development_dependency 'rake'
28
28
  spec.add_development_dependency 'rspec', '~> 3.0'
29
+ spec.add_development_dependency 'simplecov'
29
30
  spec.add_development_dependency 'yard'
30
31
 
31
32
  if RUBY_PLATFORM == 'java'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: with_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Case Commons, LLC
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-11-14 00:00:00.000000000 Z
13
+ date: 2019-12-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: '4.2'
21
+ version: '5.2'
22
22
  - - "<"
23
23
  - !ruby/object:Gem::Version
24
24
  version: '6.1'
@@ -28,7 +28,7 @@ dependencies:
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- version: '4.2'
31
+ version: '5.2'
32
32
  - - "<"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '6.1'
@@ -88,6 +88,20 @@ dependencies:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
90
  version: '3.0'
91
+ - !ruby/object:Gem::Dependency
92
+ name: simplecov
93
+ requirement: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ type: :development
99
+ prerelease: false
100
+ version_requirements: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
91
105
  - !ruby/object:Gem::Dependency
92
106
  name: yard
93
107
  requirement: !ruby/object:Gem::Requirement
@@ -160,14 +174,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
174
  requirements:
161
175
  - - ">="
162
176
  - !ruby/object:Gem::Version
163
- version: '2.3'
177
+ version: '2.4'
164
178
  required_rubygems_version: !ruby/object:Gem::Requirement
165
179
  requirements:
166
180
  - - ">="
167
181
  - !ruby/object:Gem::Version
168
182
  version: '0'
169
183
  requirements: []
170
- rubygems_version: 3.0.6
184
+ rubygems_version: 3.1.2
171
185
  signing_key:
172
186
  specification_version: 4
173
187
  summary: Dynamically build a model within an RSpec context