activemodel-csv_validator 0.3.0 → 0.4.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: cb70efb8db9417e97271234408c30226f68d3762f6bead02ad62d32a35ab3174
4
- data.tar.gz: a0f5e957d47de6f6a267df40cfeb43c42b95a68026ec66912d40aaf714babdee
3
+ metadata.gz: 8fd12e527341af3f693fe8e8212c684751c8e45fcb4de9d3069ee3a482df0445
4
+ data.tar.gz: 8533c6126319e1a956c9f5f4d9e84e00ad6e991e884ceca6b2d6a65c5d1f845a
5
5
  SHA512:
6
- metadata.gz: d3082350fdb33f663589223f7de9530bdb39d0195d5da153ec014c552cb437227330aed4324080021fb7c90363590b48dbdf1bcdb9b39e5f927d9fdeb58657db
7
- data.tar.gz: 7adad3526afda27bb99ef778bfb779c6abd58b477d76c2f078c9df5199dc8f3706eafa801f88326476e7cce2686d04467fdcc71db87545cb099f621b17e8145b
6
+ metadata.gz: f10ad1fb87c9378e8dcadbd46e85207073345871fed953793e53a4ed20ef1d0d0a8e687a86c23fcad8ddb25fd4a68d11e9f8ef2bce87d2aea90e374dfbbf1b52
7
+ data.tar.gz: ccd3dafafbdff4fed38a0fa6ff09fb9d3c68d8d8c1fa197a1636f12dba017f72d351b58b8d18ae0955681f9c503fcb038e22514791ed6c3200a103834e09ffd9
@@ -0,0 +1,22 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ ruby: ["2.7", "3.0", "3.1", ruby-head, jruby-head]
13
+
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+ - name: Set up Ruby
17
+ uses: ruby/setup-ruby@v1
18
+ with:
19
+ bundler-cache: true # 'bundle install' and cache gems
20
+ ruby-version: ${{ matrix.ruby }}
21
+ - name: Run tests
22
+ run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.4.0
2
+
3
+ - Drop support ruby@2.6
4
+ - Drop support rails@6.0
5
+ - Proc can now be passed to `headers` option.
6
+
1
7
  ## 0.2.0
2
8
 
3
9
  - Drop support ruby@2.5
@@ -22,9 +22,9 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.required_ruby_version = '>= 2.6.0'
26
- spec.add_dependency "activemodel", ">= 5.2.0"
27
- spec.add_dependency "activesupport", ">= 5.2.0"
25
+ spec.required_ruby_version = '>= 2.7.0'
26
+ spec.add_dependency "activemodel", ">= 6.1.0"
27
+ spec.add_dependency "activesupport", ">= 6.1.0"
28
28
  spec.add_development_dependency "bundler", "~> 2.0"
29
29
  spec.add_development_dependency "rake", "~> 13.0"
30
30
  spec.add_development_dependency "rspec", "~> 3.0"
@@ -1,5 +1,5 @@
1
1
  module Activemodel
2
2
  module CsvValidator
3
- VERSION = '0.3.0'
3
+ VERSION = '0.4.0'
4
4
  end
5
5
  end
@@ -20,7 +20,8 @@ module ActiveModel
20
20
  end
21
21
 
22
22
  if options[:headers].present?
23
- missing_headers = options[:headers] - rows.headers
23
+ headers = options[:headers].respond_to?(:call) ? options[:headers].call(record) : options[:headers]
24
+ missing_headers = headers - rows.headers
24
25
  if missing_headers.present?
25
26
  record.errors.add(attribute, :missing_headers, missing_headers: missing_headers.to_sentence)
26
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemodel-csv_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - aki77
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-20 00:00:00.000000000 Z
11
+ date: 2022-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.2.0
19
+ version: 6.1.0
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: 5.2.0
26
+ version: 6.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 5.2.0
33
+ version: 6.1.0
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: 5.2.0
40
+ version: 6.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -87,9 +87,9 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".github/workflows/ci.yml"
90
91
  - ".gitignore"
91
92
  - ".rspec"
92
- - ".travis.yml"
93
93
  - CHANGELOG.md
94
94
  - CODE_OF_CONDUCT.md
95
95
  - Gemfile
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- version: 2.6.0
119
+ version: 2.7.0
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.3
7
- before_install: gem install bundler -v 2.0.2