hanami-validations 0.7.1 → 1.0.0.beta1

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
  SHA1:
3
- metadata.gz: 19deaecafd1fb9bc26097efa8785534d25b495e5
4
- data.tar.gz: b398eebca907ceb037b87546fa960b43761aecc7
3
+ metadata.gz: 99ff96a9cb4892a83e5856bc634d177c66d6f37c
4
+ data.tar.gz: f0ecb809653141a79d11829105c67d9d1ed3df23
5
5
  SHA512:
6
- metadata.gz: 973a248ca84c88407d367b2794306aa1d858ba4a700a0b68b0ff221a79a9f0a4d1dc88354996fe4bcac8b046f7f2a9671509c8b774be09240cb2a0f1ce1e1289
7
- data.tar.gz: c0736c5de5147707b2ca3af5263d740e77dba0a9f3d00b79ecb68e37968702cefdf1b2d26460431edd3e69ed5e7226c2883edd2fbe5cdde7ade771207b1f000c
6
+ metadata.gz: c2290ef3644c39145c4c98278881acab876ba15ba73b85a5de6e597d111a9cd64cd27801067ddcfaa4c42922ccdd513e056d6181c8b8b296f0543e0e4b74c2d4
7
+ data.tar.gz: 4f5e9e1c02ed5565329c26f029984b02112b0744de1a21e5bdf96e4953ff410de916aff632721b5327ea33be8813b7b42d2fde4fed232839b1ff7ff7f792508d
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Hanami::Validations
2
2
  Validations mixin for Ruby objects
3
3
 
4
+ ## v1.0.0.beta1 - 2017-02-14
5
+ ### Added
6
+ - [Luca Guidi] Official support for Ruby: MRI 2.4
7
+
8
+ ### Fixed
9
+ - [Luca Guidi] Don't let inline predicates to discard other YAML error messages
10
+
4
11
  ## v0.7.1 - 2016-11-18
5
12
  ### Fixed
6
13
  - [Luca Guidi] Ensure custom validators to work with concrete classes with name
data/README.md CHANGED
@@ -119,7 +119,11 @@ It checks if the the given value is an array, and iterates through its elements
119
119
  required(:codes) { array? { each { int? } } }
120
120
  ```
121
121
 
122
- This example checks if `codes` is an array and if all the elements are integers.
122
+ This example checks if `codes` is an array and if all the elements are integers, whereas the following example checks there are a minimum of 2 elements and all elements are strings.
123
+
124
+ ```ruby
125
+ required(:codes) { array? { min_size?(2) & each { str? } } }
126
+ ```
123
127
 
124
128
  #### Emptiness
125
129
 
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
  spec.required_ruby_version = '>= 2.3.0'
21
21
 
22
- spec.add_dependency 'hanami-utils', '~> 0.9'
22
+ spec.add_dependency 'hanami-utils', '~> 1.0.0.beta1'
23
23
  spec.add_dependency 'dry-validation', '~> 0.10'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1.6'
@@ -1,6 +1,6 @@
1
1
  module Hanami
2
2
  module Validations
3
3
  # @since 0.1.0
4
- VERSION = '0.7.1'.freeze
4
+ VERSION = '1.0.0.beta1'.freeze
5
5
  end
6
6
  end
@@ -280,7 +280,7 @@ module Hanami
280
280
 
281
281
  lambda do |config|
282
282
  config.messages = _predicates_module && _predicates_module.messages || DEFAULT_MESSAGES_ENGINE
283
- config.messages_file = _predicates_module && _predicates_module.messages_path
283
+ config.messages_file = _predicates_module.messages_path unless _predicates_module.nil?
284
284
  end
285
285
  end
286
286
 
@@ -318,7 +318,13 @@ module Hanami
318
318
  end
319
319
 
320
320
  def messages
321
- super.messages.merge(__messages)
321
+ engine = super
322
+
323
+ if engine.respond_to?(:merge)
324
+ engine
325
+ else
326
+ engine.messages
327
+ end.merge(__messages)
322
328
  end
323
329
  end
324
330
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 1.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-11-18 00:00:00.000000000 Z
13
+ date: 2017-02-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: hanami-utils
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '0.9'
21
+ version: 1.0.0.beta1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '0.9'
28
+ version: 1.0.0.beta1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: dry-validation
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -117,12 +117,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
117
  version: 2.3.0
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - ">="
120
+ - - ">"
121
121
  - !ruby/object:Gem::Version
122
- version: '0'
122
+ version: 1.3.1
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.6.4
125
+ rubygems_version: 2.6.8
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Validations mixin for Ruby objects