dry-schema 1.5.6 → 1.6.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: 26cb433ca43bd564e72496a3662035e91cec686962c2c5a3ba9bad0a0c8da5a0
4
- data.tar.gz: 8a2decf348bf29e1e2c38e27a0237a872ea78db8b19af32ccdb11adc4928c7dd
3
+ metadata.gz: 286fc26d17ad546acf8370b4fdba754c85f495a0d6dd8da0c4ce564066c30859
4
+ data.tar.gz: b6f080291da562eca2e1e4407e9fc079062b45a12c7d24739137b5e7502be429
5
5
  SHA512:
6
- metadata.gz: 5d6b9d1a6cb3033aadfead9b2dac136cab561c2c0fd2cd97fbd58087168b42ee1cb9e5be34e745c9292d094c6ca2a621aa412b8126b7610d324fdd60f364a373
7
- data.tar.gz: 97dc3d3283afbc0c996da01cc2ff566f409dce596a43b5f8158e9f44529e6a0f3427406c9b919bbfb4f9b2884ddb2567dbdb5379e8eb9d4fc49addccee41885c
6
+ metadata.gz: 340ac4d40469019131a1bc3ff0284b95ee7d83b151b013cc91ded5eb1629cc35ab535ac7e3c8a3dc70033e955ec91629df8ed18b89b44f9cacb50c4c1231f283
7
+ data.tar.gz: 4847c4e9ee2d9fa28051d6ec0a160415505e3f7475c95ef550cca927ed9b59f78da4be4333064a9e750a395cb497e09d36f9e70e44333e46850506f6365ba82e
@@ -1,3 +1,33 @@
1
+ <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
+
3
+ ## 1.6.0 2021-01-21
4
+
5
+
6
+ ### Fixed
7
+
8
+ - Using sum types with a i18n backend no longer crashes (issue #328 fixes via #331) (@tylerhunt)
9
+
10
+ ### Changed
11
+
12
+ - Inferring predicates from class names is deprecated. It's very unlikely your code depends on it,
13
+ however, if it does, you'll get an exception with instructions. (@flash-gordon)
14
+
15
+ If you see an exception and don't rely on inferring, just disable it with:
16
+
17
+ ```ruby
18
+ Dry::Schema::PredicateInferrer::Compiler.infer_predicate_by_class_name false
19
+ ```
20
+
21
+ Otherwise, enable it explicitly:
22
+
23
+ ```ruby
24
+ Dry::Schema::PredicateInferrer::Compiler.infer_predicate_by_class_name true
25
+ ```
26
+
27
+ See https://github.com/dry-rb/dry-schema/issues/335 for rationale.
28
+
29
+ [Compare v1.5.6...v1.6.0](https://github.com/dry-rb/dry-schema/compare/v1.5.6...v1.6.0)
30
+
1
31
  ## 1.5.6 2020-10-21
2
32
 
3
33
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2020 dry-rb team
3
+ Copyright (c) 2015-2021 dry-rb team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -21,7 +21,7 @@
21
21
 
22
22
  This library officially supports the following Ruby versions:
23
23
 
24
- * MRI >= `2.5
24
+ * MRI >= `2.5`
25
25
  * jruby >= `9.2`
26
26
 
27
27
  ## License
@@ -34,11 +34,10 @@ Gem::Specification.new do |spec|
34
34
  # to update dependencies edit project.yml
35
35
  spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
36
36
  spec.add_runtime_dependency "dry-configurable", "~> 0.8", ">= 0.8.3"
37
- spec.add_runtime_dependency "dry-core", "~> 0.4"
38
- spec.add_runtime_dependency "dry-equalizer", "~> 0.2"
37
+ spec.add_runtime_dependency "dry-core", "~> 0.5", ">= 0.5"
39
38
  spec.add_runtime_dependency "dry-initializer", "~> 3.0"
40
39
  spec.add_runtime_dependency "dry-logic", "~> 1.0"
41
- spec.add_runtime_dependency "dry-types", "~> 1.4"
40
+ spec.add_runtime_dependency "dry-types", "~> 1.5"
42
41
 
43
42
  spec.add_development_dependency "bundler"
44
43
  spec.add_development_dependency "rake"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/equalizer"
3
+ require "dry/core/equalizer"
4
4
  require "dry/configurable"
5
5
 
6
6
  require "dry/schema/constants"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dry/core/cache"
4
- require "dry/equalizer"
4
+ require "dry/core/equalizer"
5
5
 
6
6
  module Dry
7
7
  module Schema
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/equalizer"
3
+ require "dry/core/equalizer"
4
4
  require "dry/core/cache"
5
5
  require "dry/schema/constants"
6
6
  require "dry/schema/key"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dry/initializer"
4
- require "dry/equalizer"
4
+ require "dry/core/equalizer"
5
5
 
6
6
  require "dry/schema/path"
7
7
  require "dry/schema/message/or"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/equalizer"
3
+ require "dry/core/equalizer"
4
4
 
5
5
  require "dry/schema/message/or/abstract"
6
6
  require "dry/schema/path"
@@ -38,7 +38,7 @@ module Dry
38
38
  #
39
39
  # @api public
40
40
  def dump
41
- @dump ||= "#{left.dump} #{messages[:or][:text]} #{right.dump}"
41
+ @dump ||= "#{left.dump} #{messages[:or]} #{right.dump}"
42
42
  end
43
43
  alias_method :to_s, :dump
44
44
 
@@ -131,7 +131,10 @@ module Dry
131
131
 
132
132
  # @api private
133
133
  def or_translator
134
- @or_translator ||= proc { |k| messages.translate(k, **default_lookup_options) }
134
+ @or_translator ||= proc { |k|
135
+ message = messages.translate(k, **default_lookup_options)
136
+ message.is_a?(Hash) ? message[:text] : message
137
+ }
135
138
  end
136
139
 
137
140
  # @api private
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/equalizer"
3
+ require "dry/core/equalizer"
4
4
 
5
5
  module Dry
6
6
  module Schema
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "set"
4
4
  require "concurrent/map"
5
- require "dry/equalizer"
5
+ require "dry/core/equalizer"
6
6
  require "dry/configurable"
7
7
 
8
8
  require "dry/schema/constants"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dry/initializer"
4
- require "dry/equalizer"
4
+ require "dry/core/equalizer"
5
5
 
6
6
  require "dry/schema/constants"
7
7
 
@@ -3,7 +3,7 @@
3
3
  require "yaml"
4
4
  require "pathname"
5
5
 
6
- require "dry/equalizer"
6
+ require "dry/core/equalizer"
7
7
  require "dry/schema/constants"
8
8
  require "dry/schema/messages/abstract"
9
9
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/equalizer"
3
+ require "dry/core/equalizer"
4
4
  require "dry/logic/operators"
5
5
 
6
6
  module Dry
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dry/initializer"
4
- require "dry/equalizer"
4
+ require "dry/core/equalizer"
5
5
 
6
6
  require "dry/schema/path"
7
7
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/equalizer"
3
+ require "dry/core/equalizer"
4
4
  require "dry/initializer"
5
5
 
6
6
  module Dry
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Schema
5
- VERSION = "1.5.6"
5
+ VERSION = "1.6.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.6
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-21 00:00:00.000000000 Z
11
+ date: 2021-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -50,28 +50,20 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.4'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '0.4'
61
- - !ruby/object:Gem::Dependency
62
- name: dry-equalizer
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
53
+ version: '0.5'
54
+ - - ">="
66
55
  - !ruby/object:Gem::Version
67
- version: '0.2'
56
+ version: '0.5'
68
57
  type: :runtime
69
58
  prerelease: false
70
59
  version_requirements: !ruby/object:Gem::Requirement
71
60
  requirements:
72
61
  - - "~>"
73
62
  - !ruby/object:Gem::Version
74
- version: '0.2'
63
+ version: '0.5'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0.5'
75
67
  - !ruby/object:Gem::Dependency
76
68
  name: dry-initializer
77
69
  requirement: !ruby/object:Gem::Requirement
@@ -106,14 +98,14 @@ dependencies:
106
98
  requirements:
107
99
  - - "~>"
108
100
  - !ruby/object:Gem::Version
109
- version: '1.4'
101
+ version: '1.5'
110
102
  type: :runtime
111
103
  prerelease: false
112
104
  version_requirements: !ruby/object:Gem::Requirement
113
105
  requirements:
114
106
  - - "~>"
115
107
  - !ruby/object:Gem::Version
116
- version: '1.4'
108
+ version: '1.5'
117
109
  - !ruby/object:Gem::Dependency
118
110
  name: bundler
119
111
  requirement: !ruby/object:Gem::Requirement
@@ -260,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
252
  - !ruby/object:Gem::Version
261
253
  version: '0'
262
254
  requirements: []
263
- rubygems_version: 3.0.3
255
+ rubygems_version: 3.1.4
264
256
  signing_key:
265
257
  specification_version: 4
266
258
  summary: Coercion and validation for data structures