dry-types 1.2.2 → 1.5.1
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 +4 -4
- data/CHANGELOG.md +405 -225
- data/LICENSE +1 -1
- data/README.md +14 -12
- data/dry-types.gemspec +26 -31
- data/lib/dry-types.rb +1 -1
- data/lib/dry/types.rb +55 -40
- data/lib/dry/types/any.rb +2 -2
- data/lib/dry/types/array.rb +2 -2
- data/lib/dry/types/array/constructor.rb +1 -1
- data/lib/dry/types/array/member.rb +1 -1
- data/lib/dry/types/builder.rb +70 -18
- data/lib/dry/types/builder_methods.rb +1 -2
- data/lib/dry/types/coercions.rb +0 -17
- data/lib/dry/types/coercions/json.rb +22 -5
- data/lib/dry/types/coercions/params.rb +20 -3
- data/lib/dry/types/compiler.rb +10 -10
- data/lib/dry/types/constrained.rb +6 -9
- data/lib/dry/types/constraints.rb +3 -3
- data/lib/dry/types/constructor.rb +40 -6
- data/lib/dry/types/constructor/function.rb +48 -32
- data/lib/dry/types/constructor/wrapper.rb +94 -0
- data/lib/dry/types/container.rb +1 -1
- data/lib/dry/types/core.rb +15 -13
- data/lib/dry/types/decorator.rb +2 -9
- data/lib/dry/types/default.rb +14 -1
- data/lib/dry/types/enum.rb +4 -3
- data/lib/dry/types/errors.rb +1 -1
- data/lib/dry/types/extensions.rb +2 -2
- data/lib/dry/types/extensions/maybe.rb +18 -17
- data/lib/dry/types/extensions/monads.rb +1 -1
- data/lib/dry/types/fn_container.rb +1 -1
- data/lib/dry/types/hash.rb +9 -15
- data/lib/dry/types/hash/constructor.rb +1 -1
- data/lib/dry/types/inflector.rb +1 -1
- data/lib/dry/types/json.rb +15 -15
- data/lib/dry/types/lax.rb +3 -6
- data/lib/dry/types/map.rb +2 -2
- data/lib/dry/types/meta.rb +3 -3
- data/lib/dry/types/module.rb +6 -6
- data/lib/dry/types/nominal.rb +11 -11
- data/lib/dry/types/params.rb +31 -28
- data/lib/dry/types/predicate_inferrer.rb +52 -11
- data/lib/dry/types/predicate_registry.rb +1 -1
- data/lib/dry/types/primitive_inferrer.rb +1 -1
- data/lib/dry/types/printer.rb +25 -25
- data/lib/dry/types/result.rb +3 -3
- data/lib/dry/types/schema.rb +26 -13
- data/lib/dry/types/schema/key.rb +15 -6
- data/lib/dry/types/spec/types.rb +65 -42
- data/lib/dry/types/sum.rb +6 -5
- data/lib/dry/types/type.rb +1 -1
- data/lib/dry/types/version.rb +1 -1
- metadata +27 -78
- data/.codeclimate.yml +0 -12
- data/.github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md +0 -10
- data/.github/ISSUE_TEMPLATE/---bug-report.md +0 -30
- data/.github/ISSUE_TEMPLATE/---feature-request.md +0 -18
- data/.github/workflows/custom_ci.yml +0 -76
- data/.github/workflows/docsite.yml +0 -34
- data/.github/workflows/sync_configs.yml +0 -34
- data/.gitignore +0 -11
- data/.rspec +0 -4
- data/.rubocop.yml +0 -92
- data/.yardopts +0 -9
- data/CODE_OF_CONDUCT.md +0 -13
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -34
- data/Rakefile +0 -22
- data/benchmarks/hash_schemas.rb +0 -55
- data/benchmarks/lax_schema.rb +0 -15
- data/benchmarks/profile_invalid_input.rb +0 -15
- data/benchmarks/profile_lax_schema_valid.rb +0 -16
- data/benchmarks/profile_valid_input.rb +0 -15
- data/benchmarks/schema_valid_vs_invalid.rb +0 -21
- data/benchmarks/setup.rb +0 -17
- data/docsite/source/array-with-member.html.md +0 -13
- data/docsite/source/built-in-types.html.md +0 -116
- data/docsite/source/constraints.html.md +0 -31
- data/docsite/source/custom-types.html.md +0 -93
- data/docsite/source/default-values.html.md +0 -91
- data/docsite/source/enum.html.md +0 -69
- data/docsite/source/extensions.html.md +0 -15
- data/docsite/source/extensions/maybe.html.md +0 -57
- data/docsite/source/extensions/monads.html.md +0 -61
- data/docsite/source/getting-started.html.md +0 -57
- data/docsite/source/hash-schemas.html.md +0 -169
- data/docsite/source/index.html.md +0 -156
- data/docsite/source/map.html.md +0 -17
- data/docsite/source/optional-values.html.md +0 -35
- data/docsite/source/sum.html.md +0 -21
data/lib/dry/types/result.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dry/core/equalizer"
|
4
4
|
|
5
5
|
module Dry
|
6
6
|
module Types
|
@@ -8,7 +8,7 @@ module Dry
|
|
8
8
|
#
|
9
9
|
# @api public
|
10
10
|
class Result
|
11
|
-
include Dry::Equalizer(:input,
|
11
|
+
include ::Dry::Equalizer(:input, immutable: true)
|
12
12
|
|
13
13
|
# @return [Object]
|
14
14
|
attr_reader :input
|
@@ -43,7 +43,7 @@ module Dry
|
|
43
43
|
#
|
44
44
|
# @api public
|
45
45
|
class Failure < Result
|
46
|
-
include Dry::Equalizer(:input, :error,
|
46
|
+
include ::Dry::Equalizer(:input, :error, immutable: true)
|
47
47
|
|
48
48
|
# @return [#to_s]
|
49
49
|
attr_reader :error
|
data/lib/dry/types/schema.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "dry/types/fn_container"
|
4
4
|
|
5
5
|
module Dry
|
6
6
|
module Types
|
@@ -83,7 +83,7 @@ module Dry
|
|
83
83
|
call_unsafe(hash, options)
|
84
84
|
end
|
85
85
|
|
86
|
-
# @param [Hash] hash
|
86
|
+
# @param input [Hash] hash
|
87
87
|
#
|
88
88
|
# @yieldparam [Failure] failure
|
89
89
|
# @yieldreturn [Result]
|
@@ -145,18 +145,10 @@ module Dry
|
|
145
145
|
#
|
146
146
|
# @api public
|
147
147
|
def to_ast(meta: true)
|
148
|
-
if RUBY_VERSION >= "2.5"
|
149
|
-
opts = options.slice(:key_transform_fn, :type_transform_fn, :strict)
|
150
|
-
else
|
151
|
-
opts = options.select { |k, _|
|
152
|
-
k == :key_transform_fn || k == :type_transform_fn || k == :strict
|
153
|
-
}
|
154
|
-
end
|
155
|
-
|
156
148
|
[
|
157
149
|
:schema,
|
158
150
|
[keys.map { |key| key.to_ast(meta: meta) },
|
159
|
-
|
151
|
+
options.slice(:key_transform_fn, :type_transform_fn, :strict),
|
160
152
|
meta ? self.meta : EMPTY_HASH]
|
161
153
|
]
|
162
154
|
end
|
@@ -179,7 +171,7 @@ module Dry
|
|
179
171
|
with(strict: strict)
|
180
172
|
end
|
181
173
|
|
182
|
-
#
|
174
|
+
# Inject a key transformation function
|
183
175
|
#
|
184
176
|
# @param [#call,nil] proc
|
185
177
|
# @param [#call,nil] block
|
@@ -190,7 +182,7 @@ module Dry
|
|
190
182
|
def with_key_transform(proc = nil, &block)
|
191
183
|
fn = proc || block
|
192
184
|
|
193
|
-
raise ArgumentError,
|
185
|
+
raise ArgumentError, "a block or callable argument is required" if fn.nil?
|
194
186
|
|
195
187
|
handle = Dry::Types::FnContainer.register(fn)
|
196
188
|
with(key_transform_fn: handle)
|
@@ -284,6 +276,27 @@ module Dry
|
|
284
276
|
Lax.new(schema(keys.map(&:lax)))
|
285
277
|
end
|
286
278
|
|
279
|
+
# Merge given schema keys into current schema
|
280
|
+
#
|
281
|
+
# A new instance is returned.
|
282
|
+
#
|
283
|
+
# @param other [Schema] schema
|
284
|
+
# @return [Schema]
|
285
|
+
#
|
286
|
+
# @api public
|
287
|
+
def merge(other)
|
288
|
+
schema(other.keys)
|
289
|
+
end
|
290
|
+
|
291
|
+
# Empty schema with the same options
|
292
|
+
#
|
293
|
+
# @return [Schema]
|
294
|
+
#
|
295
|
+
# @api public
|
296
|
+
def clear
|
297
|
+
with(keys: EMPTY_ARRAY)
|
298
|
+
end
|
299
|
+
|
287
300
|
private
|
288
301
|
|
289
302
|
# @param [Array<Dry::Types::Schema::Keys>] keys
|
data/lib/dry/types/schema/key.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "dry/core/equalizer"
|
4
|
+
require "dry/core/deprecations"
|
5
5
|
|
6
6
|
module Dry
|
7
7
|
module Types
|
@@ -103,6 +103,15 @@ module Dry
|
|
103
103
|
__new__(type.lax).required(false)
|
104
104
|
end
|
105
105
|
|
106
|
+
# Make wrapped type optional
|
107
|
+
#
|
108
|
+
# @return [Key]
|
109
|
+
#
|
110
|
+
# @api public
|
111
|
+
def optional
|
112
|
+
__new__(type.optional)
|
113
|
+
end
|
114
|
+
|
106
115
|
# Dump to internal AST representation
|
107
116
|
#
|
108
117
|
# @return [Array]
|
@@ -122,13 +131,13 @@ module Dry
|
|
122
131
|
# @see Dry::Types::Meta#meta
|
123
132
|
#
|
124
133
|
# @api public
|
125
|
-
def meta(data =
|
126
|
-
if
|
134
|
+
def meta(data = Undefined)
|
135
|
+
if Undefined.equal?(data) || !data.key?(:omittable)
|
127
136
|
super
|
128
137
|
else
|
129
138
|
self.class.warn(
|
130
|
-
|
131
|
-
|
139
|
+
"Using meta for making schema keys is deprecated, " \
|
140
|
+
"please use .omittable or .required(false) instead" \
|
132
141
|
"\n" + Core::Deprecations::STACK.()
|
133
142
|
)
|
134
143
|
super.required(!data[:omittable])
|
data/lib/dry/types/spec/types.rb
CHANGED
@@ -1,79 +1,79 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
RSpec.shared_examples_for
|
3
|
+
RSpec.shared_examples_for "Dry::Types::Nominal without primitive" do
|
4
4
|
def be_boolean
|
5
5
|
satisfy { |x| x == true || x == false }
|
6
6
|
end
|
7
7
|
|
8
|
-
describe
|
9
|
-
it
|
8
|
+
describe "#constrained?" do
|
9
|
+
it "returns a boolean value" do
|
10
10
|
expect(type.constrained?).to be_boolean
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
describe
|
15
|
-
it
|
14
|
+
describe "#default?" do
|
15
|
+
it "returns a boolean value" do
|
16
16
|
expect(type.default?).to be_boolean
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
describe
|
21
|
-
it
|
20
|
+
describe "#valid?" do
|
21
|
+
it "returns a boolean value" do
|
22
22
|
expect(type.valid?(1)).to be_boolean
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
describe
|
27
|
-
it
|
26
|
+
describe "#eql?" do
|
27
|
+
it "has #eql? defined" do
|
28
28
|
expect(type).to eql(type)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
describe
|
33
|
-
it
|
32
|
+
describe "#==" do
|
33
|
+
it "has #== defined" do
|
34
34
|
expect(type).to eq(type)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
describe
|
39
|
-
it
|
38
|
+
describe "#optional?" do
|
39
|
+
it "returns a boolean value" do
|
40
40
|
expect(type.optional?).to be_boolean
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
describe
|
45
|
-
it
|
46
|
-
expect(type.to_s).to start_with(
|
44
|
+
describe "#to_s" do
|
45
|
+
it "returns a custom string representation" do
|
46
|
+
expect(type.to_s).to start_with("#<Dry::Types") if type.class.name.start_with?("Dry::Types")
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
describe
|
50
|
+
describe "#to_proc" do
|
51
51
|
subject(:callable) { type.to_proc }
|
52
52
|
|
53
|
-
it
|
53
|
+
it "converts a type to a proc" do
|
54
54
|
expect(callable).to be_a(Proc)
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
RSpec.shared_examples_for
|
60
|
-
describe
|
61
|
-
it
|
62
|
-
with_meta = type.meta(foo: :bar).meta(baz:
|
59
|
+
RSpec.shared_examples_for "Dry::Types::Nominal#meta" do
|
60
|
+
describe "#meta" do
|
61
|
+
it "allows setting meta information" do
|
62
|
+
with_meta = type.meta(foo: :bar).meta(baz: "1")
|
63
63
|
|
64
64
|
expect(with_meta).to be_instance_of(type.class)
|
65
|
-
expect(with_meta.meta).to eql(foo: :bar, baz:
|
65
|
+
expect(with_meta.meta).to eql(foo: :bar, baz: "1")
|
66
66
|
end
|
67
67
|
|
68
|
-
it
|
68
|
+
it "equalizes on empty meta" do
|
69
69
|
expect(type).to eql(type.meta({}))
|
70
70
|
end
|
71
71
|
|
72
|
-
it
|
73
|
-
expect(type).to_not eql(type.meta(i_am:
|
72
|
+
it "equalizes on filled meta" do
|
73
|
+
expect(type).to_not eql(type.meta(i_am: "different"))
|
74
74
|
end
|
75
75
|
|
76
|
-
it
|
76
|
+
it "is locally immutable" do
|
77
77
|
expect(type.meta).to be_a ::Hash
|
78
78
|
expect(type.meta).to be_frozen
|
79
79
|
expect(type.meta).not_to have_key :immutable_test
|
@@ -84,24 +84,24 @@ RSpec.shared_examples_for 'Dry::Types::Nominal#meta' do
|
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
|
-
describe
|
88
|
-
it
|
87
|
+
describe "#pristine" do
|
88
|
+
it "erases meta" do
|
89
89
|
expect(type.meta(foo: :bar).pristine).to eql(type)
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
94
|
RSpec.shared_examples_for Dry::Types::Nominal do
|
95
|
-
it_behaves_like
|
95
|
+
it_behaves_like "Dry::Types::Nominal without primitive"
|
96
96
|
|
97
|
-
describe
|
98
|
-
it
|
97
|
+
describe "#primitive" do
|
98
|
+
it "returns a class" do
|
99
99
|
expect(type.primitive).to be_instance_of(Class)
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
describe
|
104
|
-
it
|
103
|
+
describe "#constructor" do
|
104
|
+
it "returns a constructor" do
|
105
105
|
constructor = type.constructor(&:to_s)
|
106
106
|
|
107
107
|
expect(constructor).to be_a(Dry::Types::Type)
|
@@ -109,33 +109,56 @@ RSpec.shared_examples_for Dry::Types::Nominal do
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
-
RSpec.shared_examples_for
|
112
|
+
RSpec.shared_examples_for "a constrained type" do |options = {inputs: Object.new}|
|
113
113
|
inputs = options[:inputs]
|
114
114
|
|
115
115
|
let(:fallback) { Object.new }
|
116
116
|
|
117
|
-
describe
|
118
|
-
it
|
117
|
+
describe "#call" do
|
118
|
+
it "yields a block on failure" do
|
119
119
|
Array(inputs).each do |input|
|
120
120
|
expect(type.(input) { fallback }).to be(fallback)
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
it
|
124
|
+
it "throws an error on invalid input" do
|
125
125
|
Array(inputs).each do |input|
|
126
126
|
expect { type.(input) }.to raise_error(Dry::Types::CoercionError)
|
127
127
|
end
|
128
128
|
end
|
129
129
|
end
|
130
|
+
|
131
|
+
describe "#constructor" do
|
132
|
+
let(:wrapping_constructor) do
|
133
|
+
type.constructor { |input, type| type.(input) { fallback } }
|
134
|
+
end
|
135
|
+
|
136
|
+
it "can be wrapped" do
|
137
|
+
Array(inputs).each do |input|
|
138
|
+
expect(wrapping_constructor.(input)).to be(fallback)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
130
142
|
end
|
131
143
|
|
132
|
-
RSpec.shared_examples_for
|
133
|
-
describe
|
134
|
-
it
|
144
|
+
RSpec.shared_examples_for "a nominal type" do |inputs: Object.new|
|
145
|
+
describe "#call" do
|
146
|
+
it "always returns the input back" do
|
135
147
|
Array(inputs).each do |input|
|
136
|
-
expect(type.(input) {
|
148
|
+
expect(type.(input) { raise }).to be(input)
|
137
149
|
expect(type.(input)).to be(input)
|
138
150
|
end
|
139
151
|
end
|
140
152
|
end
|
141
153
|
end
|
154
|
+
|
155
|
+
RSpec.shared_examples_for "a composable constructor" do
|
156
|
+
describe "#constructor" do
|
157
|
+
it "has aliases for composition" do
|
158
|
+
expect(type.method(:append)).to eql(type.method(:constructor))
|
159
|
+
expect(type.method(:prepend)).to eql(type.method(:constructor))
|
160
|
+
expect(type.method(:<<)).to eql(type.method(:constructor))
|
161
|
+
expect(type.method(:>>)).to eql(type.method(:constructor))
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
data/lib/dry/types/sum.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "dry/core/equalizer"
|
4
|
+
require "dry/types/options"
|
5
|
+
require "dry/types/meta"
|
5
6
|
|
6
7
|
module Dry
|
7
8
|
module Types
|
@@ -50,7 +51,7 @@ module Dry
|
|
50
51
|
#
|
51
52
|
# @api public
|
52
53
|
def name
|
53
|
-
[left, right].map(&:name).join(
|
54
|
+
[left, right].map(&:name).join(" | ")
|
54
55
|
end
|
55
56
|
|
56
57
|
# @return [false]
|
@@ -142,8 +143,8 @@ module Dry
|
|
142
143
|
# @see [Meta#meta]
|
143
144
|
#
|
144
145
|
# @api public
|
145
|
-
def meta(data =
|
146
|
-
if
|
146
|
+
def meta(data = Undefined)
|
147
|
+
if Undefined.equal?(data)
|
147
148
|
optional? ? right.meta : super
|
148
149
|
elsif optional?
|
149
150
|
self.class.new(left, right.meta(data), **options)
|
data/lib/dry/types/type.rb
CHANGED
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: 1.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -44,34 +44,20 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.5'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
50
|
+
version: '0.5'
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: '0.
|
57
|
+
version: '0.5'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: dry-equalizer
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '0.3'
|
68
|
-
type: :runtime
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '0.3'
|
60
|
+
version: '0.5'
|
75
61
|
- !ruby/object:Gem::Dependency
|
76
62
|
name: dry-inflector
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,104 +118,67 @@ dependencies:
|
|
132
118
|
requirements:
|
133
119
|
- - "~>"
|
134
120
|
- !ruby/object:Gem::Version
|
135
|
-
version: '0
|
121
|
+
version: '1.0'
|
136
122
|
type: :development
|
137
123
|
prerelease: false
|
138
124
|
version_requirements: !ruby/object:Gem::Requirement
|
139
125
|
requirements:
|
140
126
|
- - "~>"
|
141
127
|
- !ruby/object:Gem::Version
|
142
|
-
version: '0
|
128
|
+
version: '1.0'
|
143
129
|
- !ruby/object:Gem::Dependency
|
144
130
|
name: rake
|
145
131
|
requirement: !ruby/object:Gem::Requirement
|
146
132
|
requirements:
|
147
|
-
- - "
|
133
|
+
- - ">="
|
148
134
|
- !ruby/object:Gem::Version
|
149
|
-
version: '
|
135
|
+
version: '0'
|
150
136
|
type: :development
|
151
137
|
prerelease: false
|
152
138
|
version_requirements: !ruby/object:Gem::Requirement
|
153
139
|
requirements:
|
154
|
-
- - "
|
140
|
+
- - ">="
|
155
141
|
- !ruby/object:Gem::Version
|
156
|
-
version: '
|
142
|
+
version: '0'
|
157
143
|
- !ruby/object:Gem::Dependency
|
158
144
|
name: rspec
|
159
145
|
requirement: !ruby/object:Gem::Requirement
|
160
146
|
requirements:
|
161
|
-
- - "
|
147
|
+
- - ">="
|
162
148
|
- !ruby/object:Gem::Version
|
163
|
-
version: '
|
149
|
+
version: '0'
|
164
150
|
type: :development
|
165
151
|
prerelease: false
|
166
152
|
version_requirements: !ruby/object:Gem::Requirement
|
167
153
|
requirements:
|
168
|
-
- - "
|
154
|
+
- - ">="
|
169
155
|
- !ruby/object:Gem::Version
|
170
|
-
version: '
|
156
|
+
version: '0'
|
171
157
|
- !ruby/object:Gem::Dependency
|
172
158
|
name: yard
|
173
159
|
requirement: !ruby/object:Gem::Requirement
|
174
160
|
requirements:
|
175
|
-
- - "
|
161
|
+
- - ">="
|
176
162
|
- !ruby/object:Gem::Version
|
177
|
-
version: 0
|
163
|
+
version: '0'
|
178
164
|
type: :development
|
179
165
|
prerelease: false
|
180
166
|
version_requirements: !ruby/object:Gem::Requirement
|
181
167
|
requirements:
|
182
|
-
- - "
|
168
|
+
- - ">="
|
183
169
|
- !ruby/object:Gem::Version
|
184
|
-
version: 0
|
170
|
+
version: '0'
|
185
171
|
description: Type system for Ruby supporting coercions, constraints and complex types
|
186
|
-
like structs, value objects, enums etc
|
172
|
+
like structs, value objects, enums etc
|
187
173
|
email:
|
188
174
|
- piotr.solnica@gmail.com
|
189
175
|
executables: []
|
190
176
|
extensions: []
|
191
177
|
extra_rdoc_files: []
|
192
178
|
files:
|
193
|
-
- ".codeclimate.yml"
|
194
|
-
- ".github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md"
|
195
|
-
- ".github/ISSUE_TEMPLATE/---bug-report.md"
|
196
|
-
- ".github/ISSUE_TEMPLATE/---feature-request.md"
|
197
|
-
- ".github/workflows/custom_ci.yml"
|
198
|
-
- ".github/workflows/docsite.yml"
|
199
|
-
- ".github/workflows/sync_configs.yml"
|
200
|
-
- ".gitignore"
|
201
|
-
- ".rspec"
|
202
|
-
- ".rubocop.yml"
|
203
|
-
- ".yardopts"
|
204
179
|
- CHANGELOG.md
|
205
|
-
- CODE_OF_CONDUCT.md
|
206
|
-
- CONTRIBUTING.md
|
207
|
-
- Gemfile
|
208
180
|
- LICENSE
|
209
181
|
- README.md
|
210
|
-
- Rakefile
|
211
|
-
- benchmarks/hash_schemas.rb
|
212
|
-
- benchmarks/lax_schema.rb
|
213
|
-
- benchmarks/profile_invalid_input.rb
|
214
|
-
- benchmarks/profile_lax_schema_valid.rb
|
215
|
-
- benchmarks/profile_valid_input.rb
|
216
|
-
- benchmarks/schema_valid_vs_invalid.rb
|
217
|
-
- benchmarks/setup.rb
|
218
|
-
- docsite/source/array-with-member.html.md
|
219
|
-
- docsite/source/built-in-types.html.md
|
220
|
-
- docsite/source/constraints.html.md
|
221
|
-
- docsite/source/custom-types.html.md
|
222
|
-
- docsite/source/default-values.html.md
|
223
|
-
- docsite/source/enum.html.md
|
224
|
-
- docsite/source/extensions.html.md
|
225
|
-
- docsite/source/extensions/maybe.html.md
|
226
|
-
- docsite/source/extensions/monads.html.md
|
227
|
-
- docsite/source/getting-started.html.md
|
228
|
-
- docsite/source/hash-schemas.html.md
|
229
|
-
- docsite/source/index.html.md
|
230
|
-
- docsite/source/map.html.md
|
231
|
-
- docsite/source/optional-values.html.md
|
232
|
-
- docsite/source/sum.html.md
|
233
182
|
- dry-types.gemspec
|
234
183
|
- lib/dry-types.rb
|
235
184
|
- lib/dry/types.rb
|
@@ -249,6 +198,7 @@ files:
|
|
249
198
|
- lib/dry/types/constraints.rb
|
250
199
|
- lib/dry/types/constructor.rb
|
251
200
|
- lib/dry/types/constructor/function.rb
|
201
|
+
- lib/dry/types/constructor/wrapper.rb
|
252
202
|
- lib/dry/types/container.rb
|
253
203
|
- lib/dry/types/core.rb
|
254
204
|
- lib/dry/types/decorator.rb
|
@@ -282,8 +232,7 @@ files:
|
|
282
232
|
- lib/dry/types/sum.rb
|
283
233
|
- lib/dry/types/type.rb
|
284
234
|
- lib/dry/types/version.rb
|
285
|
-
-
|
286
|
-
homepage: https://github.com/dry-rb/dry-types
|
235
|
+
homepage: https://dry-rb.org/gems/dry-types
|
287
236
|
licenses:
|
288
237
|
- MIT
|
289
238
|
metadata:
|
@@ -299,16 +248,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
299
248
|
requirements:
|
300
249
|
- - ">="
|
301
250
|
- !ruby/object:Gem::Version
|
302
|
-
version: 2.
|
251
|
+
version: 2.5.0
|
303
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
304
253
|
requirements:
|
305
254
|
- - ">="
|
306
255
|
- !ruby/object:Gem::Version
|
307
256
|
version: '0'
|
308
257
|
requirements: []
|
309
|
-
rubygems_version: 3.
|
258
|
+
rubygems_version: 3.1.4
|
310
259
|
signing_key:
|
311
260
|
specification_version: 4
|
312
261
|
summary: Type system for Ruby supporting coercions, constraints and complex types
|
313
|
-
like structs, value objects, enums etc
|
262
|
+
like structs, value objects, enums etc
|
314
263
|
test_files: []
|