accept_values_for 0.9.2 → 0.9.5

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: fca3117b3183fe7afaaf7b453d836121971a75647708196a09f5b80a39a8fe32
4
- data.tar.gz: aade7200045bec438d115d3bdb9c3bc490bc4a3bd69a4227dd1e50b0afea09c3
3
+ metadata.gz: 3b508c7c635a2c407ca9502daeccb96698ec5826668c868dc20733c1569e46bc
4
+ data.tar.gz: 51d0cf9c872af0b7f80457a9b94e8efa0720b3c2bad2a0b946befc79d15324af
5
5
  SHA512:
6
- metadata.gz: 852fa26e15bf3bbb929519172638191a0b81ef531e0bbcca62122f9c009628e60c03d56b0cc66cf553a093bfc1a087853346f7f98839ff7cae4fdbcb8c9740be
7
- data.tar.gz: 542ba60849de1e3746d40483b35013b04597614b2cae5e9eb342d9686cf36832b1ddcefef3891caf058af87416faf305ec0abaa1f1e11dbe63ffe21dc584230f
6
+ metadata.gz: d94ed3a6b1044e4a97ac3ea4980910aa77b27299b5f18c130f3de0ad2ae2805245678af4737b59918791188d450907b99561c6cdd0b8f22dd88629c1b98bd2c7
7
+ data.tar.gz: 393070aa3d8d89b370850b2b73b4c720a503e52f8193b6d76f52824050f4a37c75c5b8e5e80e273444e11d198616d9f55007d65d149d63b6404282e72ee49da9
@@ -5,23 +5,28 @@ jobs:
5
5
  strategy:
6
6
  fail-fast: false
7
7
  matrix:
8
- ruby: [2.6, 2.7, 3.0]
8
+ ruby: ['3.0', '3.1', '3.2', '3.3']
9
9
  gemfile:
10
- - activemodel_5_2
11
- - activemodel_6_0
12
10
  - activemodel_6_1
13
11
  - activemodel_7_0
12
+ - activemodel_7_1
13
+ - activemodel_7_2
14
+ - activemodel_8_0
14
15
  exclude:
15
- - ruby: 2.6
16
- gemfile: activemodel_7_0
17
- - ruby: 3.0
18
- gemfile: activemodel_5_2
16
+ # Rails 7.2 requires Ruby >= 3.1.0
17
+ - ruby: '3.0'
18
+ gemfile: 'activemodel_7_2'
19
+ # Rails 8.0 requires Ruby >= 3.2.0
20
+ - ruby: '3.0'
21
+ gemfile: 'activemodel_8_0'
22
+ - ruby: '3.1'
23
+ gemfile: 'activemodel_8_0'
19
24
  name: Ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}
20
25
  runs-on: ubuntu-latest
21
26
  env:
22
27
  BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
23
28
  steps:
24
- - uses: actions/checkout@v2
29
+ - uses: actions/checkout@v4
25
30
  - uses: ruby/setup-ruby@v1
26
31
  with:
27
32
  ruby-version: ${{ matrix.ruby }}
@@ -0,0 +1,45 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ build:
8
+ name: Build + Publish
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+ packages: write
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: Set up Ruby 3.2
17
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
18
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
19
+ # uses: ruby/setup-ruby@v1
20
+ uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
21
+ with:
22
+ ruby-version: 3.2.2
23
+
24
+ - name: Publish to GPR
25
+ run: |
26
+ mkdir -p $HOME/.gem
27
+ touch $HOME/.gem/credentials
28
+ chmod 0600 $HOME/.gem/credentials
29
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
30
+ gem build *.gemspec
31
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
32
+ env:
33
+ GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
34
+ OWNER: ${{ github.repository_owner }}
35
+
36
+ - name: Publish to RubyGems
37
+ run: |
38
+ mkdir -p $HOME/.gem
39
+ touch $HOME/.gem/credentials
40
+ chmod 0600 $HOME/.gem/credentials
41
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
42
+ gem build *.gemspec
43
+ gem push *.gem
44
+ env:
45
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
data/CHANGELOG.md CHANGED
@@ -1,56 +1,71 @@
1
- # 0.9.1
1
+ # Changelog
2
+
3
+ ## 0.9.5
4
+
5
+ * Rails 8.0 support
6
+
7
+ ## 0.9.4
8
+
9
+ * Test release
10
+
11
+ ## 0.9.3
12
+
13
+ * Rails 7.1 support
14
+ * Support for Ruby 2.6 and 2.7, and Rails 5.2 and 6.0 has been dropped
15
+
16
+ ## 0.9.1
2
17
 
3
18
  * Rails 7.0 support
4
19
 
5
- # 0.6.0
20
+ ## 0.6.0
6
21
 
7
22
  * [ENHANCEMENT] Deprecate Rubies 1.8.7 and 1.9.2
8
23
  * [ENHANCEMENT] Remove `discover` matcher
9
24
  * [BUGFIX] Open dependency requirements to allow installation alongside Rails 4
10
25
  * [ENHANCEMENT] Replace Jeweler with Bundler
11
26
 
12
- # 0.5.1 / 2013-10-20
27
+ ## 0.5.1 / 2013-10-20
13
28
 
14
29
  * [ENHANCEMENT] Refactor matcher messaging
15
30
  * [ENHANCEMENT] Deprecate `discover` matcher in favor of `include`
16
31
 
17
- # 0.4.3 / 2011-03-29
32
+ ## 0.4.3 / 2011-03-29
18
33
 
19
34
  * [BUGFIX] Revert values set during validation testing
20
35
 
21
- # 0.4.2 / 2011-03-15
36
+ ## 0.4.2 / 2011-03-15
22
37
 
23
38
  * [BUGFIX] Change error access from `#on` to `#[]`
24
39
 
25
- # 0.4.1 / 2011-02-24
40
+ ## 0.4.1 / 2011-02-24
26
41
 
27
42
  * [FEATURE] Add wider Active Model compatibility
28
43
 
29
- # 0.3.1 / 2010-09-08
44
+ ## 0.3.1 / 2010-09-08
30
45
 
31
46
  * [FEATURE] Add Rails 3 compatibility
32
47
 
33
- # 0.3.0 / 2010-07-11
48
+ ## 0.3.0 / 2010-07-11
34
49
 
35
50
  * [FEATURE] Add `discover` matcher
36
51
 
37
- # 0.2.1 / 2010-06-28
52
+ ## 0.2.1 / 2010-06-28
38
53
 
39
54
  * [FEATURE] Add support for negative matching
40
55
 
41
- # 0.2.0 / 2010-05-13
56
+ ## 0.2.0 / 2010-05-13
42
57
 
43
58
  * [FEATURE] Fail only if the validation in question fails
44
59
  * [BUGFIX] Add `activerecord` and `rspec` runtime dependencies
45
60
 
46
- # 0.1.1 / 2010-05-04
61
+ ## 0.1.1 / 2010-05-04
47
62
 
48
63
  * [BUGFIX] Fix non-attribute validation testing
49
64
 
50
- # 0.1.0 / 2010-05-04
65
+ ## 0.1.0 / 2010-05-04
51
66
 
52
67
  * [FEATURE] Enable testing methods as well as attributes
53
68
 
54
- # 0.0.1 / 2010-05-03
69
+ ## 0.0.1 / 2010-05-03
55
70
 
56
71
  * Initial release
data/Gemfile CHANGED
@@ -3,9 +3,8 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  group :test do
6
- gem "activerecord", "~> 7.0", require: "active_record"
7
- gem "rspec", "~> 3.10"
8
- gem "sqlite3", "~> 1.4"
6
+ gem "activemodel", "~> 8.0.0"
7
+ gem "rspec", "~> 3.12"
9
8
  gem "bump", "~> 0.10.0"
10
9
  end
11
10
 
data/README.md CHANGED
@@ -25,7 +25,7 @@ end
25
25
 
26
26
  ## Dependencies
27
27
 
28
- * Active Model (5, 6, 7)
28
+ * Active Model (6, 7, 8)
29
29
  * RSpec (3)
30
30
 
31
31
  ## Installation
@@ -1,8 +1,10 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require_relative 'lib/accept_values_for/version'
4
+
3
5
  Gem::Specification.new do |spec|
4
6
  spec.name = "accept_values_for"
5
- spec.version = "0.9.2"
7
+ spec.version = AcceptValuesFor::VERSION
6
8
 
7
9
  spec.author = "Bogdan Gusiev"
8
10
  spec.email = "agresso@gmail.com"
@@ -18,9 +20,14 @@ Gem::Specification.new do |spec|
18
20
  spec.files = `git ls-files -z`.split("\x0")
19
21
  spec.test_files = spec.files.grep(/^spec/)
20
22
 
21
- spec.add_dependency "activemodel", ">= 5.0", "< 7.1"
22
- spec.add_dependency "rspec", ">= 3.0", "< 4.0"
23
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
24
+
25
+ spec.metadata["homepage_uri"] = spec.homepage
26
+ spec.metadata["source_code_uri"] = spec.homepage
27
+
28
+ spec.add_dependency "activemodel", ">= 6.1", "< 8.1"
29
+ spec.add_dependency "rspec", ">= 3.10", "< 4.0"
23
30
 
24
31
  spec.add_development_dependency "bundler", "~> 2.2"
25
- spec.add_development_dependency "rake", "~> 12.3"
32
+ spec.add_development_dependency "rake", "~> 13.0"
26
33
  end
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "activemodel", "~> 7.1.0"
6
+
7
+ group :test do
8
+ gem "activerecord", "~> 7.1.0", require: "active_record"
9
+ gem "rspec", "~> 3.12"
10
+ gem "sqlite3", "~> 1.6"
11
+ end
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "activemodel", "~> 7.2.0"
6
+
7
+ group :test do
8
+ gem "activerecord", "~> 7.2.0", require: "active_record"
9
+ gem "rspec", "~> 3.13"
10
+ gem "sqlite3", "~> 1.6"
11
+ end
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: ".."
4
+
5
+ gem "activemodel", "~> 8.0.0"
6
+
7
+ group :test do
8
+ gem "activerecord", "~> 8.0.0", require: "active_record"
9
+ gem "rspec", "~> 3.13"
10
+ gem "sqlite3", "~> 2.2"
11
+ end
@@ -0,0 +1,3 @@
1
+ module AcceptValuesFor
2
+ VERSION = "0.9.5"
3
+ end
@@ -1,5 +1,6 @@
1
1
  require "rspec"
2
2
 
3
+ require "accept_values_for/version"
3
4
  require "accept_values_for/helpers"
4
5
  require "accept_values_for/matcher"
5
6
 
data/spec/spec_helper.rb CHANGED
@@ -5,34 +5,17 @@ Bundler.require(:test)
5
5
  I18n.enforce_available_locales = false
6
6
 
7
7
  RSpec.configure do |config|
8
- config.before(:suite) do
9
- ActiveRecord::Base.establish_connection(
10
- :adapter => "sqlite3",
11
- :database => ":memory:"
12
- )
13
-
14
- ActiveRecord::Schema.verbose = false
15
- ActiveRecord::Schema.define(:version => 1) do
16
- create_table :groups do |t|
17
- t.string :name
18
- end
19
-
20
- create_table :people do |t|
21
- t.integer :group_id
22
- t.string :gender
23
- t.string :name
24
- end
25
- end
26
- end
27
-
28
8
  config.before do
29
- class ::Group < ActiveRecord::Base
30
- has_many :people
9
+ class ::Group
10
+ include ActiveModel::Model
11
+
12
+ attr_accessor :name
31
13
  end
32
14
 
33
- class ::Person < ActiveRecord::Base
34
- belongs_to :group
15
+ class ::Person
16
+ include ActiveModel::Model
35
17
 
18
+ attr_accessor :group, :gender
36
19
  validates_presence_of :group
37
20
  validates_inclusion_of :gender, :in => ["MALE", "FEMALE"]
38
21
  end
@@ -42,7 +25,7 @@ RSpec.configure do |config|
42
25
  Object.send(:remove_const, :Person)
43
26
  Object.send(:remove_const, :Group)
44
27
  end
45
-
28
+
46
29
  config.expect_with(:rspec) do |c|
47
30
  c.syntax = [:should, :expect]
48
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: accept_values_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdan Gusiev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-17 00:00:00.000000000 Z
11
+ date: 2024-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -16,27 +16,27 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '6.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.1'
22
+ version: '8.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '5.0'
29
+ version: '6.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.1'
32
+ version: '8.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rspec
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '3.0'
39
+ version: '3.10'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '4.0'
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '3.0'
49
+ version: '3.10'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '4.0'
@@ -70,14 +70,14 @@ dependencies:
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '12.3'
73
+ version: '13.0'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '12.3'
80
+ version: '13.0'
81
81
  description: Writing specs for complex validations is annoying. AcceptValuesFor makes
82
82
  iteasy to test your validations with real world values, asserting which valuesshould
83
83
  be accepted by your model and which should not.
@@ -87,6 +87,7 @@ extensions: []
87
87
  extra_rdoc_files: []
88
88
  files:
89
89
  - ".github/workflows/ci.yml"
90
+ - ".github/workflows/gem-push.yml"
90
91
  - ".gitignore"
91
92
  - CHANGELOG.md
92
93
  - Gemfile
@@ -94,19 +95,23 @@ files:
94
95
  - README.md
95
96
  - Rakefile
96
97
  - accept_values_for.gemspec
97
- - gemfiles/activemodel_5_2.gemfile
98
- - gemfiles/activemodel_6_0.gemfile
99
98
  - gemfiles/activemodel_6_1.gemfile
100
99
  - gemfiles/activemodel_7_0.gemfile
100
+ - gemfiles/activemodel_7_1.gemfile
101
+ - gemfiles/activemodel_7_2.gemfile
102
+ - gemfiles/activemodel_8_0.gemfile
101
103
  - lib/accept_values_for.rb
102
104
  - lib/accept_values_for/helpers.rb
103
105
  - lib/accept_values_for/matcher.rb
106
+ - lib/accept_values_for/version.rb
104
107
  - spec/accept_values_for_spec.rb
105
108
  - spec/spec_helper.rb
106
109
  homepage: https://github.com/bogdan/accept_values_for
107
110
  licenses:
108
111
  - MIT
109
- metadata: {}
112
+ metadata:
113
+ homepage_uri: https://github.com/bogdan/accept_values_for
114
+ source_code_uri: https://github.com/bogdan/accept_values_for
110
115
  post_install_message:
111
116
  rdoc_options: []
112
117
  require_paths:
@@ -115,14 +120,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
120
  requirements:
116
121
  - - ">="
117
122
  - !ruby/object:Gem::Version
118
- version: '0'
123
+ version: 3.0.0
119
124
  required_rubygems_version: !ruby/object:Gem::Requirement
120
125
  requirements:
121
126
  - - ">="
122
127
  - !ruby/object:Gem::Version
123
128
  version: '0'
124
129
  requirements: []
125
- rubygems_version: 3.2.22
130
+ rubygems_version: 3.5.11
126
131
  signing_key:
127
132
  specification_version: 4
128
133
  summary: Test complex Active Record validations with RSpec
@@ -1,11 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec path: ".."
4
-
5
- gem "activemodel", "~> 5.2.0"
6
-
7
- group :test do
8
- gem "activerecord", "~> 5.2.0", require: "active_record"
9
- gem "rspec", "~> 3.8"
10
- gem "sqlite3", "~> 1.4"
11
- end
@@ -1,11 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec path: ".."
4
-
5
- gem "activemodel", "~> 6.0.0"
6
-
7
- group :test do
8
- gem "activerecord", "~> 6.0.0", require: "active_record"
9
- gem "rspec", "~> 3.8"
10
- gem "sqlite3", "~> 1.4"
11
- end