dry-validation-matchers 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +35 -0
- data/CHANGELOG.md +5 -0
- data/README.md +2 -4
- data/lib/dry/validation/matchers/validate_matcher.rb +4 -4
- data/lib/dry/validation/matchers/version.rb +1 -1
- metadata +7 -7
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb356fd9e7bd319025961ef39a1ea6d0418de27d0898035b3076bd3b3226e74d
|
4
|
+
data.tar.gz: 5cda89f507dfc43126811c8c14fbb742e3a310f06caae942e8c572df84ad1804
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b80ecd94935e51a6cb59458fd27476c12bb76565e1a182325a33e76f5387c52c74f3e3e411a05cec7df184480cddc841187b307bb9fb5e023f0eeea914692a96
|
7
|
+
data.tar.gz: 1299dd2ef1395819995aa17835eeb442452357e36701500893e14dac2551bc01b8ab7beb680527b32b180f1e7d6b48a6632d1642d8f42e20a265373e776f0e52
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
- name: Set up Ruby
|
27
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
28
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
29
|
+
# uses: ruby/setup-ruby@v1
|
30
|
+
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
31
|
+
with:
|
32
|
+
ruby-version: ${{ matrix.ruby-version }}
|
33
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
34
|
+
- name: Run tests
|
35
|
+
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## [1.2.2] - 2021-06-15
|
8
|
+
### Fixed
|
9
|
+
- Use long-hand name for types. Not sure when it changed, but the short-hand
|
10
|
+
(i.e. `str?`) no longer works
|
11
|
+
|
7
12
|
## [1.2.1] - 2019-11-22
|
8
13
|
### Fixed
|
9
14
|
- Deprecation messages re BigDecimal()
|
data/README.md
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# Dry::Validation::Matchers
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/bloom-solutions/dry-validation-matchers.svg?branch=master)](https://travis-ci.org/bloom-solutions/dry-validation-matchers)
|
4
|
-
|
5
3
|
RSpec matchers for [Dry::Validation](dry-rb.org/gems/dry-validation).
|
6
4
|
|
7
5
|
## Installation
|
@@ -40,8 +38,8 @@ RSpec.describe "Integration with RSpec", type: %i[dry_validation] do
|
|
40
38
|
params do
|
41
39
|
required(:username).filled
|
42
40
|
required(:first_name)
|
43
|
-
required(:age).filled(:
|
44
|
-
required(:last_name).filled(:
|
41
|
+
required(:age).filled(:integer)
|
42
|
+
required(:last_name).filled(:string)
|
45
43
|
optional(:mobile).filled
|
46
44
|
optional(:email)
|
47
45
|
optional(:decimal_value)
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module Dry::Validation::Matchers
|
2
2
|
class ValidateMatcher
|
3
3
|
|
4
|
-
DEFAULT_TYPE = :
|
4
|
+
DEFAULT_TYPE = :string
|
5
5
|
TYPE_ERRORS = {
|
6
|
-
|
6
|
+
string: {
|
7
7
|
test_value: "str",
|
8
8
|
message: "must be a string",
|
9
9
|
},
|
10
|
-
|
10
|
+
integer: {
|
11
11
|
test_value: 43,
|
12
12
|
message: "must be an integer",
|
13
13
|
},
|
@@ -111,7 +111,7 @@ module Dry::Validation::Matchers
|
|
111
111
|
check_macro_usage!(schema)
|
112
112
|
end
|
113
113
|
|
114
|
-
def filled(type
|
114
|
+
def filled(type=DEFAULT_TYPE)
|
115
115
|
@check_filled = true
|
116
116
|
@type = type
|
117
117
|
self
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-validation-matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-validation
|
@@ -73,10 +73,10 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
+
- ".github/workflows/ruby.yml"
|
76
77
|
- ".gitignore"
|
77
78
|
- ".rspec"
|
78
79
|
- ".ruby-version"
|
79
|
-
- ".travis.yml"
|
80
80
|
- CHANGELOG.md
|
81
81
|
- CODE_OF_CONDUCT.md
|
82
82
|
- Gemfile
|
@@ -96,7 +96,7 @@ licenses:
|
|
96
96
|
- MIT
|
97
97
|
metadata:
|
98
98
|
allowed_push_host: https://rubygems.org
|
99
|
-
post_install_message:
|
99
|
+
post_install_message:
|
100
100
|
rdoc_options: []
|
101
101
|
require_paths:
|
102
102
|
- lib
|
@@ -111,8 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
115
|
-
signing_key:
|
114
|
+
rubygems_version: 3.1.6
|
115
|
+
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: RSpec matchers for dry-validation
|
118
118
|
test_files: []
|