dry-types 1.0.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +2 -5
  3. data/.github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md +10 -0
  4. data/.github/ISSUE_TEMPLATE/---bug-report.md +34 -0
  5. data/.github/ISSUE_TEMPLATE/---feature-request.md +18 -0
  6. data/.github/workflows/custom_ci.yml +76 -0
  7. data/.github/workflows/docsite.yml +34 -0
  8. data/.github/workflows/sync_configs.yml +34 -0
  9. data/.gitignore +1 -1
  10. data/.rspec +3 -1
  11. data/.rubocop.yml +89 -0
  12. data/CHANGELOG.md +127 -3
  13. data/CODE_OF_CONDUCT.md +13 -0
  14. data/CONTRIBUTING.md +2 -2
  15. data/Gemfile +12 -6
  16. data/LICENSE +17 -17
  17. data/README.md +2 -2
  18. data/Rakefile +2 -2
  19. data/benchmarks/hash_schemas.rb +8 -6
  20. data/benchmarks/lax_schema.rb +0 -1
  21. data/benchmarks/profile_invalid_input.rb +1 -1
  22. data/benchmarks/profile_lax_schema_valid.rb +1 -1
  23. data/benchmarks/profile_valid_input.rb +1 -1
  24. data/docsite/source/array-with-member.html.md +13 -0
  25. data/docsite/source/built-in-types.html.md +116 -0
  26. data/docsite/source/constraints.html.md +31 -0
  27. data/docsite/source/custom-types.html.md +93 -0
  28. data/docsite/source/default-values.html.md +91 -0
  29. data/docsite/source/enum.html.md +69 -0
  30. data/docsite/source/extensions.html.md +15 -0
  31. data/docsite/source/extensions/maybe.html.md +57 -0
  32. data/docsite/source/extensions/monads.html.md +61 -0
  33. data/docsite/source/getting-started.html.md +57 -0
  34. data/docsite/source/hash-schemas.html.md +169 -0
  35. data/docsite/source/index.html.md +156 -0
  36. data/docsite/source/map.html.md +17 -0
  37. data/docsite/source/optional-values.html.md +35 -0
  38. data/docsite/source/sum.html.md +21 -0
  39. data/dry-types.gemspec +19 -19
  40. data/lib/dry/types.rb +9 -4
  41. data/lib/dry/types/any.rb +2 -2
  42. data/lib/dry/types/array.rb +6 -0
  43. data/lib/dry/types/array/constructor.rb +32 -0
  44. data/lib/dry/types/array/member.rb +10 -3
  45. data/lib/dry/types/builder.rb +2 -2
  46. data/lib/dry/types/builder_methods.rb +34 -8
  47. data/lib/dry/types/coercions.rb +19 -6
  48. data/lib/dry/types/coercions/params.rb +4 -4
  49. data/lib/dry/types/compiler.rb +2 -2
  50. data/lib/dry/types/constrained.rb +6 -1
  51. data/lib/dry/types/constructor.rb +10 -42
  52. data/lib/dry/types/constructor/function.rb +4 -5
  53. data/lib/dry/types/core.rb +27 -8
  54. data/lib/dry/types/decorator.rb +3 -2
  55. data/lib/dry/types/enum.rb +2 -1
  56. data/lib/dry/types/extensions.rb +4 -0
  57. data/lib/dry/types/extensions/maybe.rb +9 -1
  58. data/lib/dry/types/extensions/monads.rb +29 -0
  59. data/lib/dry/types/hash.rb +11 -12
  60. data/lib/dry/types/hash/constructor.rb +5 -5
  61. data/lib/dry/types/json.rb +4 -0
  62. data/lib/dry/types/lax.rb +4 -4
  63. data/lib/dry/types/map.rb +8 -4
  64. data/lib/dry/types/meta.rb +1 -1
  65. data/lib/dry/types/module.rb +6 -6
  66. data/lib/dry/types/nominal.rb +3 -4
  67. data/lib/dry/types/params.rb +9 -0
  68. data/lib/dry/types/predicate_inferrer.rb +197 -0
  69. data/lib/dry/types/predicate_registry.rb +34 -0
  70. data/lib/dry/types/primitive_inferrer.rb +97 -0
  71. data/lib/dry/types/printer.rb +17 -12
  72. data/lib/dry/types/schema.rb +16 -22
  73. data/lib/dry/types/schema/key.rb +19 -1
  74. data/lib/dry/types/spec/types.rb +6 -7
  75. data/lib/dry/types/sum.rb +2 -2
  76. data/lib/dry/types/version.rb +1 -1
  77. metadata +67 -35
  78. data/.travis.yml +0 -27
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dry/logic/predicates'
4
+
5
+ module Dry
6
+ module Types
7
+ # A registry with predicate objects from `Dry::Logic::Predicates`
8
+ #
9
+ # @api private
10
+ class PredicateRegistry
11
+ # @api private
12
+ attr_reader :predicates
13
+
14
+ # @api private
15
+ attr_reader :has_predicate
16
+
17
+ # @api private
18
+ def initialize(predicates = Logic::Predicates)
19
+ @predicates = predicates
20
+ @has_predicate = ::Kernel.instance_method(:respond_to?).bind(@predicates)
21
+ end
22
+
23
+ # @api private
24
+ def [](name)
25
+ predicates[name]
26
+ end
27
+
28
+ # @api private
29
+ def key?(name)
30
+ has_predicate.(name)
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'dry/core/cache'
4
+
5
+ module Dry
6
+ module Types
7
+ # PrimitiveInferrer returns the list of classes matching a type.
8
+ #
9
+ # @api public
10
+ class PrimitiveInferrer
11
+ extend Core::Cache
12
+
13
+ # Compiler reduces type AST into a list of primitives
14
+ #
15
+ # @api private
16
+ class Compiler
17
+ # @api private
18
+ def visit(node)
19
+ meth, rest = node
20
+ public_send(:"visit_#{meth}", rest)
21
+ end
22
+
23
+ # @api private
24
+ def visit_nominal(node)
25
+ type, _ = node
26
+ type
27
+ end
28
+
29
+ # @api private
30
+ def visit_hash(_)
31
+ ::Hash
32
+ end
33
+ alias_method :visit_schema, :visit_hash
34
+
35
+ # @api private
36
+ def visit_array(_)
37
+ ::Array
38
+ end
39
+
40
+ # @api private
41
+ def visit_lax(node)
42
+ visit(node)
43
+ end
44
+
45
+ # @api private
46
+ def visit_constructor(node)
47
+ other, * = node
48
+ visit(other)
49
+ end
50
+
51
+ # @api private
52
+ def visit_enum(node)
53
+ other, * = node
54
+ visit(other)
55
+ end
56
+
57
+ # @api private
58
+ def visit_sum(node)
59
+ left, right = node
60
+
61
+ [visit(left), visit(right)].flatten(1)
62
+ end
63
+
64
+ # @api private
65
+ def visit_constrained(node)
66
+ other, * = node
67
+ visit(other)
68
+ end
69
+
70
+ # @api private
71
+ def visit_any(_)
72
+ ::Object
73
+ end
74
+ end
75
+
76
+ # @return [Compiler]
77
+ # @api private
78
+ attr_reader :compiler
79
+
80
+ # @api private
81
+ def initialize
82
+ @compiler = Compiler.new
83
+ end
84
+
85
+ # Infer primitives from the provided type
86
+ #
87
+ # @return [Array[Class]]
88
+ #
89
+ # @api private
90
+ def [](type)
91
+ self.class.fetch_or_store(type) do
92
+ Array(compiler.visit(type.to_ast)).freeze
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -8,6 +8,7 @@ module Dry
8
8
  Nominal => :visit_nominal,
9
9
  Constructor => :visit_constructor,
10
10
  Hash::Constructor => :visit_constructor,
11
+ Array::Constructor => :visit_constructor,
11
12
  Constrained => :visit_constrained,
12
13
  Constrained::Coercible => :visit_constrained,
13
14
  Hash => :visit_hash,
@@ -26,7 +27,7 @@ module Dry
26
27
  }
27
28
 
28
29
  def call(type)
29
- output = "".dup
30
+ output = ''.dup
30
31
  visit(type) { |str| output << str }
31
32
  "#<Dry::Types[#{output}]>"
32
33
  end
@@ -43,16 +44,20 @@ module Dry
43
44
  end
44
45
 
45
46
  def visit_any(_)
46
- yield "Any"
47
+ yield 'Any'
47
48
  end
48
49
 
49
- def visit_array(_)
50
- yield "Array"
50
+ def visit_array(type)
51
+ visit_options(EMPTY_HASH, type.meta) do |opts|
52
+ yield "Array#{opts}"
53
+ end
51
54
  end
52
55
 
53
56
  def visit_array_member(array)
54
57
  visit(array.member) do |type|
55
- yield "Array<#{type}>"
58
+ visit_options(EMPTY_HASH, array.meta) do |opts|
59
+ yield "Array<#{type}#{opts}>"
60
+ end
56
61
  end
57
62
  end
58
63
 
@@ -74,7 +79,7 @@ module Dry
74
79
  options = constrained.options.dup
75
80
  rule = options.delete(:rule)
76
81
 
77
- visit_options(options) do |opts|
82
+ visit_options(options) do |_opts|
78
83
  yield "Constrained<#{type} rule=[#{rule}]>"
79
84
  end
80
85
  end
@@ -110,7 +115,7 @@ module Dry
110
115
  header = "Schema<#{schema_parameters}keys={"
111
116
 
112
117
  if size.zero?
113
- yield "#{ header}}>"
118
+ yield "#{header}}>"
114
119
  else
115
120
  yield header.dup << keys.map { |key|
116
121
  visit(key) { |type| type }
@@ -126,7 +131,7 @@ module Dry
126
131
  options.delete(:key_type)
127
132
  options.delete(:value_type)
128
133
 
129
- visit_options(options) do |opts|
134
+ visit_options(options) do |_opts|
130
135
  yield "Map<#{key} => #{value}>"
131
136
  end
132
137
  end
@@ -193,7 +198,7 @@ module Dry
193
198
  yield "Enum<#{type} values={#{values}}#{opts}>"
194
199
  else
195
200
  mapping_str = mapping.map { |key, value|
196
- "#{ key.inspect }=>#{value.inspect}"
201
+ "#{key.inspect}=>#{value.inspect}"
197
202
  }.join(', ')
198
203
  yield "Enum<#{type} mapping={#{mapping_str}}#{opts}>"
199
204
  end
@@ -251,14 +256,14 @@ module Dry
251
256
 
252
257
  case fn
253
258
  when Method
254
- yield "#{ fn.receiver }.#{ fn.name }"
259
+ yield "#{fn.receiver}.#{fn.name}"
255
260
  when Proc
256
261
  path, line = fn.source_location
257
262
 
258
- if line && line.zero?
263
+ if line&.zero?
259
264
  yield ".#{path}"
260
265
  elsif path
261
- yield "#{path.sub(Dir.pwd + '/', EMPTY_STRING) }:#{line}"
266
+ yield "#{path.sub(Dir.pwd + '/', EMPTY_STRING)}:#{line}"
262
267
  elsif fn.lambda?
263
268
  yield '(lambda)'
264
269
  else
@@ -156,8 +156,8 @@ module Dry
156
156
  [
157
157
  :schema,
158
158
  [keys.map { |key| key.to_ast(meta: meta) },
159
- opts,
160
- meta ? self.meta : EMPTY_HASH]
159
+ opts,
160
+ meta ? self.meta : EMPTY_HASH]
161
161
  ]
162
162
  end
163
163
 
@@ -175,8 +175,8 @@ module Dry
175
175
  # @return [Schema]
176
176
  #
177
177
  # @api public
178
- def strict
179
- with(strict: true)
178
+ def strict(strict = true)
179
+ with(strict: strict)
180
180
  end
181
181
 
182
182
  # Injects a key transformation function
@@ -190,9 +190,7 @@ module Dry
190
190
  def with_key_transform(proc = nil, &block)
191
191
  fn = proc || block
192
192
 
193
- if fn.nil?
194
- raise ArgumentError, "a block or callable argument is required"
195
- end
193
+ raise ArgumentError, 'a block or callable argument is required' if fn.nil?
196
194
 
197
195
  handle = Dry::Types::FnContainer.register(fn)
198
196
  with(key_transform_fn: handle)
@@ -203,7 +201,7 @@ module Dry
203
201
  # @return [Boolean]
204
202
  #
205
203
  # @api public
206
- def trasform_keys?
204
+ def transform_keys?
207
205
  !options[:key_transform_fn].nil?
208
206
  end
209
207
 
@@ -294,10 +292,10 @@ module Dry
294
292
  #
295
293
  # @api private
296
294
  def merge_keys(*keys)
297
- keys.
298
- flatten(1).
299
- each_with_object({}) { |key, merged| merged[key.name] = key }.
300
- values
295
+ keys
296
+ .flatten(1)
297
+ .each_with_object({}) { |key, merged| merged[key.name] = key }
298
+ .values
301
299
  end
302
300
 
303
301
  # Validate and coerce a hash. Raise an exception on any error
@@ -315,19 +313,17 @@ module Dry
315
313
  if type
316
314
  begin
317
315
  result[k] = type.call_unsafe(value)
318
- rescue ConstraintError => error
319
- raise SchemaError.new(type.name, value, error.result)
320
- rescue CoercionError => error
321
- raise SchemaError.new(type.name, value, error.message)
316
+ rescue ConstraintError => e
317
+ raise SchemaError.new(type.name, value, e.result)
318
+ rescue CoercionError => e
319
+ raise SchemaError.new(type.name, value, e.message)
322
320
  end
323
321
  elsif strict?
324
322
  raise unexpected_keys(hash.keys)
325
323
  end
326
324
  end
327
325
 
328
- if result.size < keys.size
329
- resolve_missing_keys(result, options)
330
- end
326
+ resolve_missing_keys(result, options) if result.size < keys.size
331
327
 
332
328
  result
333
329
  end
@@ -351,9 +347,7 @@ module Dry
351
347
  end
352
348
  end
353
349
 
354
- if result.size < keys.size
355
- resolve_missing_keys(result, options, &block)
356
- end
350
+ resolve_missing_keys(result, options, &block) if result.size < keys.size
357
351
 
358
352
  result
359
353
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'dry/equalizer'
4
+ require 'dry/core/deprecations'
4
5
 
5
6
  module Dry
6
7
  module Types
@@ -14,6 +15,7 @@ module Dry
14
15
  #
15
16
  # @see Dry::Types::Schema
16
17
  class Key
18
+ extend ::Dry::Core::Deprecations[:'dry-types']
17
19
  include Type
18
20
  include Dry::Equalizer(:name, :type, :options, inspect: false)
19
21
  include Decorator
@@ -94,7 +96,7 @@ module Dry
94
96
  #
95
97
  # @api public
96
98
  def lax
97
- super.required(false)
99
+ __new__(type.lax).required(false)
98
100
  end
99
101
 
100
102
  # Dump to internal AST representation
@@ -113,6 +115,22 @@ module Dry
113
115
  ]
114
116
  end
115
117
 
118
+ # @see Dry::Types::Meta#meta
119
+ #
120
+ # @api public
121
+ def meta(data = nil)
122
+ if data.nil? || !data.key?(:omittable)
123
+ super
124
+ else
125
+ self.class.warn(
126
+ 'Using meta for making schema keys is deprecated, ' \
127
+ 'please use .omittable or .required(false) instead' \
128
+ "\n" + Core::Deprecations::STACK.()
129
+ )
130
+ super.required(!data[:omittable])
131
+ end
132
+ end
133
+
116
134
  private
117
135
 
118
136
  # @api private
@@ -2,7 +2,7 @@
2
2
 
3
3
  RSpec.shared_examples_for 'Dry::Types::Nominal without primitive' do
4
4
  def be_boolean
5
- satisfy { |x| x == true || x == false }
5
+ satisfy { |x| x == true || x == false }
6
6
  end
7
7
 
8
8
  describe '#constrained?' do
@@ -43,9 +43,7 @@ RSpec.shared_examples_for 'Dry::Types::Nominal without primitive' do
43
43
 
44
44
  describe '#to_s' do
45
45
  it 'returns a custom string representation' do
46
- if type.class.name.start_with?('Dry::Types')
47
- expect(type.to_s).to start_with('#<Dry::Types')
48
- end
46
+ expect(type.to_s).to start_with('#<Dry::Types') if type.class.name.start_with?('Dry::Types')
49
47
  end
50
48
  end
51
49
 
@@ -81,7 +79,7 @@ RSpec.shared_examples_for 'Dry::Types::Nominal#meta' do
81
79
  expect(type.meta).not_to have_key :immutable_test
82
80
  derived = type.meta(immutable_test: 1)
83
81
  expect(derived.meta).to be_frozen
84
- expect(derived.meta).to eql({immutable_test: 1})
82
+ expect(derived.meta).to eql(immutable_test: 1)
85
83
  expect(type.meta).not_to have_key :immutable_test
86
84
  end
87
85
  end
@@ -111,7 +109,9 @@ RSpec.shared_examples_for Dry::Types::Nominal do
111
109
  end
112
110
  end
113
111
 
114
- RSpec.shared_examples_for 'a constrained type' do |inputs: Object.new|
112
+ RSpec.shared_examples_for 'a constrained type' do |options = { inputs: Object.new }|
113
+ inputs = options[:inputs]
114
+
115
115
  let(:fallback) { Object.new }
116
116
 
117
117
  describe '#call' do
@@ -139,4 +139,3 @@ RSpec.shared_examples_for 'a nominal type' do |inputs: Object.new|
139
139
  end
140
140
  end
141
141
  end
142
-
data/lib/dry/types/sum.rb CHANGED
@@ -40,7 +40,7 @@ module Dry
40
40
  # @param [Hash] options
41
41
  #
42
42
  # @api private
43
- def initialize(left, right, options = {})
43
+ def initialize(left, right, **options)
44
44
  super
45
45
  @left, @right = left, right
46
46
  freeze
@@ -146,7 +146,7 @@ module Dry
146
146
  if data.nil?
147
147
  optional? ? right.meta : super
148
148
  elsif optional?
149
- self.class.new(left, right.meta(data), options)
149
+ self.class.new(left, right.meta(data), **options)
150
150
  else
151
151
  super
152
152
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Types
5
- VERSION = '1.0.0'
5
+ VERSION = '1.2.1'
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.0.0
4
+ version: 1.2.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: 2019-04-23 00:00:00.000000000 Z
11
+ date: 2019-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -25,79 +25,79 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: dry-core
28
+ name: dry-container
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.4'
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 0.4.4
33
+ version: '0.3'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
- version: '0.4'
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 0.4.4
40
+ version: '0.3'
47
41
  - !ruby/object:Gem::Dependency
48
- name: dry-inflector
42
+ name: dry-core
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0.1'
47
+ version: '0.4'
54
48
  - - ">="
55
49
  - !ruby/object:Gem::Version
56
- version: 0.1.2
50
+ version: 0.4.4
57
51
  type: :runtime
58
52
  prerelease: false
59
53
  version_requirements: !ruby/object:Gem::Requirement
60
54
  requirements:
61
55
  - - "~>"
62
56
  - !ruby/object:Gem::Version
63
- version: '0.1'
57
+ version: '0.4'
64
58
  - - ">="
65
59
  - !ruby/object:Gem::Version
66
- version: 0.1.2
60
+ version: 0.4.4
67
61
  - !ruby/object:Gem::Dependency
68
- name: dry-container
62
+ name: dry-equalizer
69
63
  requirement: !ruby/object:Gem::Requirement
70
64
  requirements:
71
65
  - - "~>"
72
66
  - !ruby/object:Gem::Version
73
- version: '0.3'
67
+ version: '0.2'
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: 0.2.2
74
71
  type: :runtime
75
72
  prerelease: false
76
73
  version_requirements: !ruby/object:Gem::Requirement
77
74
  requirements:
78
75
  - - "~>"
79
76
  - !ruby/object:Gem::Version
80
- version: '0.3'
77
+ version: '0.2'
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 0.2.2
81
81
  - !ruby/object:Gem::Dependency
82
- name: dry-equalizer
82
+ name: dry-inflector
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: '0.2'
87
+ version: '0.1'
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
- version: 0.2.2
90
+ version: 0.1.2
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '0.2'
97
+ version: '0.1'
98
98
  - - ">="
99
99
  - !ruby/object:Gem::Version
100
- version: 0.2.2
100
+ version: 0.1.2
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: dry-logic
103
103
  requirement: !ruby/object:Gem::Requirement
@@ -105,6 +105,9 @@ dependencies:
105
105
  - - "~>"
106
106
  - !ruby/object:Gem::Version
107
107
  version: '1.0'
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: 1.0.2
108
111
  type: :runtime
109
112
  prerelease: false
110
113
  version_requirements: !ruby/object:Gem::Requirement
@@ -112,6 +115,9 @@ dependencies:
112
115
  - - "~>"
113
116
  - !ruby/object:Gem::Version
114
117
  version: '1.0'
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: 1.0.2
115
121
  - !ruby/object:Gem::Dependency
116
122
  name: bundler
117
123
  requirement: !ruby/object:Gem::Requirement
@@ -127,47 +133,47 @@ dependencies:
127
133
  - !ruby/object:Gem::Version
128
134
  version: '0'
129
135
  - !ruby/object:Gem::Dependency
130
- name: rake
136
+ name: dry-monads
131
137
  requirement: !ruby/object:Gem::Requirement
132
138
  requirements:
133
139
  - - "~>"
134
140
  - !ruby/object:Gem::Version
135
- version: '11.0'
141
+ version: '0.2'
136
142
  type: :development
137
143
  prerelease: false
138
144
  version_requirements: !ruby/object:Gem::Requirement
139
145
  requirements:
140
146
  - - "~>"
141
147
  - !ruby/object:Gem::Version
142
- version: '11.0'
148
+ version: '0.2'
143
149
  - !ruby/object:Gem::Dependency
144
- name: rspec
150
+ name: rake
145
151
  requirement: !ruby/object:Gem::Requirement
146
152
  requirements:
147
153
  - - "~>"
148
154
  - !ruby/object:Gem::Version
149
- version: '3.3'
155
+ version: '11.0'
150
156
  type: :development
151
157
  prerelease: false
152
158
  version_requirements: !ruby/object:Gem::Requirement
153
159
  requirements:
154
160
  - - "~>"
155
161
  - !ruby/object:Gem::Version
156
- version: '3.3'
162
+ version: '11.0'
157
163
  - !ruby/object:Gem::Dependency
158
- name: dry-monads
164
+ name: rspec
159
165
  requirement: !ruby/object:Gem::Requirement
160
166
  requirements:
161
167
  - - "~>"
162
168
  - !ruby/object:Gem::Version
163
- version: '0.2'
169
+ version: '3.3'
164
170
  type: :development
165
171
  prerelease: false
166
172
  version_requirements: !ruby/object:Gem::Requirement
167
173
  requirements:
168
174
  - - "~>"
169
175
  - !ruby/object:Gem::Version
170
- version: '0.2'
176
+ version: '3.3'
171
177
  - !ruby/object:Gem::Dependency
172
178
  name: yard
173
179
  requirement: !ruby/object:Gem::Requirement
@@ -191,12 +197,18 @@ extensions: []
191
197
  extra_rdoc_files: []
192
198
  files:
193
199
  - ".codeclimate.yml"
200
+ - ".github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md"
201
+ - ".github/ISSUE_TEMPLATE/---bug-report.md"
202
+ - ".github/ISSUE_TEMPLATE/---feature-request.md"
203
+ - ".github/workflows/custom_ci.yml"
204
+ - ".github/workflows/docsite.yml"
205
+ - ".github/workflows/sync_configs.yml"
194
206
  - ".gitignore"
195
207
  - ".rspec"
196
208
  - ".rubocop.yml"
197
- - ".travis.yml"
198
209
  - ".yardopts"
199
210
  - CHANGELOG.md
211
+ - CODE_OF_CONDUCT.md
200
212
  - CONTRIBUTING.md
201
213
  - Gemfile
202
214
  - LICENSE
@@ -209,11 +221,27 @@ files:
209
221
  - benchmarks/profile_valid_input.rb
210
222
  - benchmarks/schema_valid_vs_invalid.rb
211
223
  - benchmarks/setup.rb
224
+ - docsite/source/array-with-member.html.md
225
+ - docsite/source/built-in-types.html.md
226
+ - docsite/source/constraints.html.md
227
+ - docsite/source/custom-types.html.md
228
+ - docsite/source/default-values.html.md
229
+ - docsite/source/enum.html.md
230
+ - docsite/source/extensions.html.md
231
+ - docsite/source/extensions/maybe.html.md
232
+ - docsite/source/extensions/monads.html.md
233
+ - docsite/source/getting-started.html.md
234
+ - docsite/source/hash-schemas.html.md
235
+ - docsite/source/index.html.md
236
+ - docsite/source/map.html.md
237
+ - docsite/source/optional-values.html.md
238
+ - docsite/source/sum.html.md
212
239
  - dry-types.gemspec
213
240
  - lib/dry-types.rb
214
241
  - lib/dry/types.rb
215
242
  - lib/dry/types/any.rb
216
243
  - lib/dry/types/array.rb
244
+ - lib/dry/types/array/constructor.rb
217
245
  - lib/dry/types/array/member.rb
218
246
  - lib/dry/types/builder.rb
219
247
  - lib/dry/types/builder_methods.rb
@@ -235,6 +263,7 @@ files:
235
263
  - lib/dry/types/errors.rb
236
264
  - lib/dry/types/extensions.rb
237
265
  - lib/dry/types/extensions/maybe.rb
266
+ - lib/dry/types/extensions/monads.rb
238
267
  - lib/dry/types/fn_container.rb
239
268
  - lib/dry/types/hash.rb
240
269
  - lib/dry/types/hash/constructor.rb
@@ -247,6 +276,9 @@ files:
247
276
  - lib/dry/types/nominal.rb
248
277
  - lib/dry/types/options.rb
249
278
  - lib/dry/types/params.rb
279
+ - lib/dry/types/predicate_inferrer.rb
280
+ - lib/dry/types/predicate_registry.rb
281
+ - lib/dry/types/primitive_inferrer.rb
250
282
  - lib/dry/types/printable.rb
251
283
  - lib/dry/types/printer.rb
252
284
  - lib/dry/types/result.rb
@@ -280,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
312
  - !ruby/object:Gem::Version
281
313
  version: '0'
282
314
  requirements: []
283
- rubygems_version: 3.0.3
315
+ rubygems_version: 3.0.6
284
316
  signing_key:
285
317
  specification_version: 4
286
318
  summary: Type system for Ruby supporting coercions, constraints and complex types