dry-types 1.9.0 → 1.9.2

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
  SHA256:
3
- metadata.gz: 126c9b985692a11e6e94e0ba2674cb4e1f988902c811031195b4eaeeb5235c72
4
- data.tar.gz: 2054c8d7ac0e5daa6b15dd4f925f8f9290b0375662f70aa4006907ae2dc272f8
3
+ metadata.gz: 6034e3448587845c41b6595ffd518dd604e3ba1cf7a3ee5bfd664af9fe6cecf6
4
+ data.tar.gz: 6158fba39db05afde81030b86873ba01272ca4cff28adf5d567b7b388a1c90ac
5
5
  SHA512:
6
- metadata.gz: cbd442d4b727460d145a9ab982464861b8d3f55884ca72d4078b8868315e3dfa14e776bdc70b51b9d995b8e9bd5195a2e4ffafe5f2d03f3106b7c67818f6a0a6
7
- data.tar.gz: fa39acdf60872ed793abee418bb2494a60daae5d5eac9daa901d958af268ecdce3de903600cbc4beb9ba101fea4d298c6240da1aa2604122f03d3c4a0d7a0233
6
+ metadata.gz: 24f2c1d34d57cef59c2c59fcd2c3b4cdec7fc8093206605bd44ed802086f2c31f8a5ea66323703258511317d68b33be54db5c33e5f816a3a5923cf212a96bc23
7
+ data.tar.gz: 93863220f7f5d4114be9a806c40e47687e1e626a272e325513b02cdbcadb1d287f9144e569d582b52403325d0af0461c9f58b84089af028514f75e483c1960d5
data/CHANGELOG.md CHANGED
@@ -2,8 +2,7 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Break Versioning](https://www.taoensso.com/break-versioning).
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Break Versioning](https://www.taoensso.com/break-versioning).
7
6
 
8
7
  ## [Unreleased]
9
8
 
@@ -19,7 +18,23 @@ and this project adheres to [Break Versioning](https://www.taoensso.com/break-ve
19
18
 
20
19
  ### Security
21
20
 
22
- [Unreleased]: https://github.com/dry-rb/dry-types/compare/v1.9.0...main
21
+ [Unreleased]: https://github.com/dry-rb/dry-types/compare/v1.9.2...main
22
+
23
+ ## [1.9.2] - 2026-11-19
24
+
25
+ ### Fixed
26
+
27
+ - Work around a [JRuby bug](https://github.com/jruby/jruby/issues/10115). (@timriley in #499)
28
+
29
+ [1.9.2]: https://github.com/dry-rb/dry-types/compare/v1.9.1...v1.9.2
30
+
31
+ ## [1.9.1] - 2026-02-06
32
+
33
+ ### Fixed
34
+
35
+ - Add workaround for a [JRuby bug](https://github.com/jruby/jruby/issues/9208). (@katafrakt in #493)
36
+
37
+ [1.9.1]: https://github.com/dry-rb/dry-types/compare/v1.9.0...v1.9.1
23
38
 
24
39
  ## [1.9.0] - 2026-01-09
25
40
 
data/README.md CHANGED
@@ -1,10 +1,15 @@
1
1
  <!--- This file is synced from hanakai-rb/repo-sync -->
2
2
 
3
- [rubygem]: https://rubygems.org/gems/dry-types
4
3
  [actions]: https://github.com/dry-rb/dry-types/actions
4
+ [chat]: https://discord.gg/naQApPAsZB
5
+ [forum]: https://discourse.hanakai.org
6
+ [rubygem]: https://rubygems.org/gems/dry-types
5
7
 
6
8
  # dry-types [![Gem Version](https://badge.fury.io/rb/dry-types.svg)][rubygem] [![CI Status](https://github.com/dry-rb/dry-types/workflows/CI/badge.svg)][actions]
7
9
 
10
+ [![Forum](https://img.shields.io/badge/Forum-dc360f?logo=discourse&logoColor=white)][forum]
11
+ [![Chat](https://img.shields.io/badge/Chat-717cf8?logo=discord&logoColor=white)][chat]
12
+
8
13
  ## Links
9
14
 
10
15
  - [User documentation](https://dry-rb.org/gems/dry-types)
data/dry-types.gemspec CHANGED
@@ -17,19 +17,18 @@ Gem::Specification.new do |spec|
17
17
  spec.description = spec.summary
18
18
  spec.homepage = "https://dry-rb.org/gems/dry-types"
19
19
  spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-types.gemspec", "lib/**/*"]
20
- spec.bindir = "bin"
21
- spec.executables = []
20
+ spec.bindir = "exe"
21
+ spec.executables = Dir["exe/*"].map { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.extra_rdoc_files = ["README.md", "CHANGELOG.md", "LICENSE"]
25
25
 
26
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
27
26
  spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-types/blob/main/CHANGELOG.md"
28
27
  spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-types"
29
28
  spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-types/issues"
30
29
  spec.metadata["funding_uri"] = "https://github.com/sponsors/hanami"
31
30
 
32
- spec.required_ruby_version = ">= 3.2"
31
+ spec.required_ruby_version = ">= 3.3"
33
32
 
34
33
  spec.add_runtime_dependency "bigdecimal", ">= 3.0"
35
34
  spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
@@ -68,8 +68,8 @@ module Dry
68
68
  # @return [Constrained]
69
69
  #
70
70
  # @api public
71
- def constrained(...)
72
- constrained_type.new(self, rule: Types.Rule(...))
71
+ def constrained(*, **, &)
72
+ constrained_type.new(self, rule: Types.Rule(*, **, &))
73
73
  end
74
74
 
75
75
  # Turn a type into a type with a default value
@@ -77,7 +77,7 @@ module Dry
77
77
  # @param [#call,nil] block Value constructor
78
78
  #
79
79
  # @return [Dry::Types::Type]
80
- def Constructor(klass, cons = nil, &block) # rubocop:disable Metrics/PerceivedComplexity:
80
+ def Constructor(klass, cons = nil, &block) # rubocop:disable Metrics/PerceivedComplexity
81
81
  if klass.is_a?(Type)
82
82
  if cons || block
83
83
  klass.constructor(cons || block)
@@ -173,9 +173,9 @@ module Dry
173
173
  # @param [#call, nil] block
174
174
  #
175
175
  # @api private
176
- def method_missing(method, ...)
176
+ def method_missing(method, *, **, &)
177
177
  if type.respond_to?(method)
178
- response = type.public_send(method, ...)
178
+ response = type.public_send(method, *, **, &)
179
179
 
180
180
  if response.is_a?(Type) && response.instance_of?(type.class)
181
181
  response.constructor_type[response, **options]
@@ -18,7 +18,7 @@ module Dry
18
18
  # @see Dry::Types::Array#of
19
19
  #
20
20
  # @api public
21
- def schema(...) = type.schema(...).constructor(fn, meta: meta)
21
+ def schema(*, **, &) = type.schema(*, **, &).constructor(fn, meta: meta)
22
22
  end
23
23
  end
24
24
  end
@@ -100,8 +100,8 @@ module Dry
100
100
 
101
101
  if unknown
102
102
  raise ::ArgumentError,
103
- "#{unknown.inspect} is not a known type namespace. " \
104
- "Supported options are #{known.map(&:inspect).join(", ")}"
103
+ "#{unknown.inspect} is not a known type namespace. " \
104
+ "Supported options are #{known.map(&:inspect).join(", ")}"
105
105
  end
106
106
  end
107
107
 
@@ -99,7 +99,7 @@ module Dry
99
99
  if !predicate.empty? && registry.key?(predicate[0])
100
100
  predicate
101
101
  else
102
- [type?: type]
102
+ [{type?: type}]
103
103
  end
104
104
  end
105
105
 
@@ -178,7 +178,7 @@ module Dry
178
178
  if values.empty?
179
179
  [pred]
180
180
  else
181
- [pred => values[0]]
181
+ [{pred => values[0]}]
182
182
  end
183
183
  end
184
184
  end
@@ -30,7 +30,7 @@ module Dry
30
30
 
31
31
  unless name.is_a?(::Symbol)
32
32
  raise ::ArgumentError,
33
- "Schemas can only contain symbol keys, #{name.inspect} given"
33
+ "Schemas can only contain symbol keys, #{name.inspect} given"
34
34
  end
35
35
 
36
36
  super
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Types
5
- VERSION = "1.9.0"
5
+ VERSION = "1.9.2"
6
6
  end
7
7
  end
data/lib/dry/types.rb CHANGED
@@ -164,9 +164,9 @@ module Dry
164
164
 
165
165
  if container.keys.any? { |key| key.split(".")[0] == underscored }
166
166
  raise ::NameError,
167
- "dry-types does not define constants for default types. " \
168
- "You can access the predefined types with [], e.g. Dry::Types['integer'] " \
169
- "or generate a module with types using Dry.Types()"
167
+ "dry-types does not define constants for default types. " \
168
+ "You can access the predefined types with [], e.g. Dry::Types['integer'] " \
169
+ "or generate a module with types using Dry.Types()"
170
170
  else
171
171
  super
172
172
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-types
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hanakai team
8
- bindir: bin
8
+ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
@@ -224,7 +224,6 @@ homepage: https://dry-rb.org/gems/dry-types
224
224
  licenses:
225
225
  - MIT
226
226
  metadata:
227
- allowed_push_host: https://rubygems.org
228
227
  changelog_uri: https://github.com/dry-rb/dry-types/blob/main/CHANGELOG.md
229
228
  source_code_uri: https://github.com/dry-rb/dry-types
230
229
  bug_tracker_uri: https://github.com/dry-rb/dry-types/issues
@@ -236,7 +235,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
236
235
  requirements:
237
236
  - - ">="
238
237
  - !ruby/object:Gem::Version
239
- version: '3.2'
238
+ version: '3.3'
240
239
  required_rubygems_version: !ruby/object:Gem::Requirement
241
240
  requirements:
242
241
  - - ">="