dry-validation 0.12.1 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/dry/validation/messages/i18n.rb +5 -0
- data/lib/dry/validation/version.rb +1 -1
- data/spec/fixtures/locales/pl.yml +4 -0
- data/spec/integration/messages/i18n_spec.rb +8 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7945890b1fef5020ac062f401377a743cc368ea6933f43af2002ac34d55931b
|
4
|
+
data.tar.gz: 6f59602ee9926bd70c30999e7c36b45343bbb00fbc95e192e207ddadc8ede7df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 172885260e7c0d248be46d7476ae6682f8a789eb76514829d1f982814c14a9d7783a5d223631d7ab22c40400f7ebecf6c7c9b98ab276048c3f654134b16ede7b
|
7
|
+
data.tar.gz: fcd3fc4e2f3cafca79f5a30fadd5ecc754890b257659433ec8d8df44b444c3a7c98bf08d35dc4f42c031d2b271ab24ec2c1ae12030523c3f588c44365ad7ed39
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,19 @@
|
|
1
|
+
# v0.12.2 2018-08-29
|
2
|
+
|
3
|
+
### Fixed
|
4
|
+
|
5
|
+
* Use correct key names for rule messages when using i18n (jozzi05)
|
6
|
+
|
7
|
+
[Compare v0.12.1...v0.12.2](https://github.com/dry-rb/dry-validation/compare/v0.12.1...v0.12.2)
|
8
|
+
|
1
9
|
# v0.12.1 2018-07-06
|
2
10
|
|
3
11
|
### Fixed
|
4
12
|
|
5
13
|
* [internal] fixed deprecation warnings (flash-gordon)
|
6
14
|
|
15
|
+
[Compare v0.12.0...v0.12.1](https://github.com/dry-rb/dry-validation/compare/v0.12.0...v0.12.1)
|
16
|
+
|
7
17
|
# v0.12.0 2018-05-31
|
8
18
|
|
9
19
|
### Changed
|
@@ -17,6 +17,11 @@ module Dry
|
|
17
17
|
t.(key, options) if key
|
18
18
|
end
|
19
19
|
|
20
|
+
def rule(name, options = {})
|
21
|
+
path = "rules.#{name}"
|
22
|
+
get(path, options) if key?(path, options)
|
23
|
+
end
|
24
|
+
|
20
25
|
def key?(key, options)
|
21
26
|
::I18n.exists?(key, options.fetch(:locale, default_locale)) ||
|
22
27
|
::I18n.exists?(key, I18n.default_locale)
|
@@ -47,6 +47,14 @@ RSpec.describe Messages::I18n do
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
context 'rule name translations' do
|
51
|
+
it 'translates rule name' do
|
52
|
+
msg = messages.rule('email')
|
53
|
+
|
54
|
+
expect(msg).to eql('Adres email')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
50
58
|
context 'with a different locale' do
|
51
59
|
it 'returns a message for a predicate' do
|
52
60
|
message = messages[:filled?, rule: :name, locale: :en]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-validation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Holland
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-08-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|
@@ -371,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
371
371
|
version: '0'
|
372
372
|
requirements: []
|
373
373
|
rubyforge_project:
|
374
|
-
rubygems_version: 2.7.
|
374
|
+
rubygems_version: 2.7.7
|
375
375
|
signing_key:
|
376
376
|
specification_version: 4
|
377
377
|
summary: A simple validation library
|