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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12cffdbb9c18b6f1ab0bb726c5a13fbd13c1178e
4
- data.tar.gz: 150931c98379624c229416370bd63cd8830bbab5
3
+ metadata.gz: 6f665eeb69ceba9c2fd336bc2a489c1b4004c40c
4
+ data.tar.gz: 155884224930392bcc2db1640b88ae2cdaa10fe3
5
5
  SHA512:
6
- metadata.gz: 7b6bd371faf9ae94c6559c01309216205c3df88614c86cb2862929b2836d8cc4c32b76d916f6deeb6e4390bb296c8e1733e85e8997b3f00092584960961e02ee
7
- data.tar.gz: 584c9552a9185595008a63c2ca6f3a8cc88ec56b7c063f720d36ff10d9c1b26b403443456416a484429cae4b7e10bd6a06995acd3adf99eb89b1026825a9fd83
6
+ metadata.gz: '08136001e7fe28fd14260861a37b91ee9ca276e480990b6ac741f39a3ee9e4603b26d20077c9984a50bd21536c4247acbffc9cba6050587b3c23c6e1be61846f'
7
+ data.tar.gz: 3fb2af20a9f42b4b025ff3ad1f460d4fbde466a3c459d1f894d09cc4266c62e7003058b6a931c8614e94c6173ecf5ae9a6a56c0ca7f82fcc2479366d63bfb7b4
@@ -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
@@ -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, &fn)
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
- super
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)
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module Types
3
- VERSION = '0.11.0'.freeze
3
+ VERSION = '0.11.1'.freeze
4
4
  end
5
5
  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: 0.11.0
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-06-30 00:00:00.000000000 Z
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.9
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