dry-types 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/dry/types/compiler.rb +1 -1
- data/lib/dry/types/constructor.rb +10 -2
- data/lib/dry/types/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f665eeb69ceba9c2fd336bc2a489c1b4004c40c
|
4
|
+
data.tar.gz: 155884224930392bcc2db1640b88ae2cdaa10fe3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08136001e7fe28fd14260861a37b91ee9ca276e480990b6ac741f39a3ee9e4603b26d20077c9984a50bd21536c4247acbffc9cba6050587b3c23c6e1be61846f'
|
7
|
+
data.tar.gz: 3fb2af20a9f42b4b025ff3ad1f460d4fbde466a3c459d1f894d09cc4266c62e7003058b6a931c8614e94c6173ecf5ae9a6a56c0ca7f82fcc2479366d63bfb7b4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# v0.11.1 2017-08-14
|
2
|
+
|
3
|
+
## Changed
|
4
|
+
|
5
|
+
* Constructors are now equalized using `fn` and `meta` too (flash-gordon)
|
6
|
+
|
7
|
+
## Fixed
|
8
|
+
|
9
|
+
* Fixed `Constructor#name` with `Sum`-types (flash-gordon)
|
10
|
+
|
11
|
+
[Compare v0.11.0...v0.11.1](https://github.com/dry-rb/dry-types/compare/v0.11.0...v0.11.1)
|
12
|
+
|
1
13
|
# v0.11.0 2017-06-30
|
2
14
|
|
3
15
|
## Added
|
data/lib/dry/types/compiler.rb
CHANGED
@@ -20,7 +20,7 @@ module Dry
|
|
20
20
|
definition, fn_register_name, meta = node
|
21
21
|
fn = Dry::Types::FnContainer[fn_register_name]
|
22
22
|
primitive = visit(definition)
|
23
|
-
Types::Constructor.new(primitive,
|
23
|
+
Types::Constructor.new(primitive, meta: meta, fn: fn)
|
24
24
|
end
|
25
25
|
|
26
26
|
def visit_safe(node)
|
@@ -3,7 +3,7 @@ require 'dry/types/decorator'
|
|
3
3
|
module Dry
|
4
4
|
module Types
|
5
5
|
class Constructor < Definition
|
6
|
-
include Dry::Equalizer(:type)
|
6
|
+
include Dry::Equalizer(:type, :options, :meta)
|
7
7
|
|
8
8
|
# @return [#call]
|
9
9
|
attr_reader :fn
|
@@ -25,7 +25,10 @@ module Dry
|
|
25
25
|
def initialize(type, options = {}, &block)
|
26
26
|
@type = type
|
27
27
|
@fn = options.fetch(:fn, block)
|
28
|
-
|
28
|
+
|
29
|
+
raise ArgumentError, 'Missing constructor block' if fn.nil?
|
30
|
+
|
31
|
+
super(type, **options, fn: fn)
|
29
32
|
end
|
30
33
|
|
31
34
|
# @return [Class]
|
@@ -33,6 +36,11 @@ module Dry
|
|
33
36
|
type.primitive
|
34
37
|
end
|
35
38
|
|
39
|
+
# @return [String]
|
40
|
+
def name
|
41
|
+
type.name
|
42
|
+
end
|
43
|
+
|
36
44
|
# @param [Object] input
|
37
45
|
# @return [Object]
|
38
46
|
def call(input)
|
data/lib/dry/types/version.rb
CHANGED
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: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
272
272
|
version: '0'
|
273
273
|
requirements: []
|
274
274
|
rubyforge_project:
|
275
|
-
rubygems_version: 2.6.
|
275
|
+
rubygems_version: 2.6.11
|
276
276
|
signing_key:
|
277
277
|
specification_version: 4
|
278
278
|
summary: Type system for Ruby supporting coercions, constraints and complex types
|