dry-types 1.8.2 → 1.8.3

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: fb0a9688e1ae1fe5305d551dcedccbfa0dfca45a7949e5d357ad98edf0f4c8ef
4
- data.tar.gz: a7dd52e7ff33aa2a1de7249bd2f03445db8b4632894e65cb8a70c1bc06dacbc5
3
+ metadata.gz: 2ac97b1fa05d97dc4e804baa514f3828d1c015c59ab46c744c25d0eb3ed3bbfb
4
+ data.tar.gz: ff74859d8d09bdb217cc7fe91679961b31dd9382f533d67dedc368d8660c7479
5
5
  SHA512:
6
- metadata.gz: cb5a3673334cddda6541c1ec24a91343ce3eb4f50d4ccf4ca625350d5b0a81863fc2a75429995ff3332e89f1ac5c4eda183c5cee1b9522c8eb35828e718d309a
7
- data.tar.gz: 217af029ec68360e982181764399ff9720ed0f2315aac2f671249ae9e91e4c0e18f3341a0580abdaf5e06bd490fab744dbafcffc1528fbc59587e869d487d7b7
6
+ metadata.gz: c49e54d687551e1b14b1389d1e98d3b08d77c8e2e9ac0601a28a9d37dfdcefc4973c465ee3ce5e94a5e0c2b4d68fac0c62b8f9c9e5c462aeba3bbaa845bc64e6
7
+ data.tar.gz: e7a169e108bd6f434bbbc1010062b7c182748bd966b68ca3baee9ba7bfec7de3d74918471bf1f19fdd448d2e3fe1366f62fc59e232dd65914f7945c06d0dba57
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
2
 
3
+ ## 1.8.3 2025-06-09
4
+
5
+
6
+ ### Fixed
7
+
8
+ - Raise error on passing a non-module object to Instance (ref #480) (@flash-gordon)
9
+
10
+
11
+ [Compare v1.8.2...v1.8.3](https://github.com/dry-rb/dry-types/compare/v1.8.2...v1.8.3)
12
+
3
13
  ## 1.8.2 2025-01-31
4
14
 
5
15
 
@@ -43,7 +43,14 @@ module Dry
43
43
  # @param [Class,Module] klass Class or module
44
44
  #
45
45
  # @return [Dry::Types::Type]
46
- def Instance(klass) = Nominal(klass).constrained(type: klass)
46
+ def Instance(klass)
47
+ unless klass.is_a?(::Module)
48
+ raise ::ArgumentError, "Expected a class or module, got #{klass.inspect}"
49
+ end
50
+
51
+ Nominal(klass).constrained(type: klass)
52
+ end
53
+
47
54
  alias_method :Strict, :Instance
48
55
 
49
56
  # Build a type with a single value
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Types
5
- VERSION = "1.8.2"
5
+ VERSION = "1.8.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-types
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-31 00:00:00.000000000 Z
11
+ date: 2025-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal