dry-struct 0.6.0 → 1.4.0
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 +242 -70
- data/LICENSE +17 -17
- data/README.md +17 -13
- data/dry-struct.gemspec +26 -27
- data/lib/dry/struct/class_interface.rb +195 -111
- data/lib/dry/struct/compiler.rb +22 -0
- data/lib/dry/struct/constructor.rb +4 -24
- data/lib/dry/struct/errors.rb +13 -3
- data/lib/dry/struct/extensions/pretty_print.rb +7 -5
- data/lib/dry/struct/extensions.rb +3 -1
- data/lib/dry/struct/hashify.rb +6 -6
- data/lib/dry/struct/printer.rb +23 -0
- data/lib/dry/struct/struct_builder.rb +48 -25
- data/lib/dry/struct/sum.rb +16 -2
- data/lib/dry/struct/value.rb +13 -4
- data/lib/dry/struct/version.rb +3 -1
- data/lib/dry/struct.rb +62 -37
- data/lib/dry-struct.rb +3 -1
- metadata +38 -62
- data/.gitignore +0 -12
- data/.rspec +0 -2
- data/.travis.yml +0 -28
- data/.yardopts +0 -4
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -28
- data/Rakefile +0 -10
- data/benchmarks/basic.rb +0 -57
- data/benchmarks/constrained.rb +0 -37
- data/bin/console +0 -12
- data/bin/setup +0 -7
- data/log/.gitkeep +0 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "dry/types/printer"
|
4
|
+
|
5
|
+
module Dry
|
6
|
+
module Types
|
7
|
+
# @api private
|
8
|
+
class Printer
|
9
|
+
MAPPING[Struct::Sum] = :visit_struct_sum
|
10
|
+
MAPPING[Struct::Constructor] = :visit_struct_constructor
|
11
|
+
|
12
|
+
def visit_struct_sum(sum)
|
13
|
+
visit_sum_constructors(sum) do |constructors|
|
14
|
+
visit_options(EMPTY_HASH, sum.meta) do |opts|
|
15
|
+
yield "Struct::Sum<#{constructors}#{opts}>"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
alias_method :visit_struct_constructor, :visit_constructor
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,28 +1,42 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "dry/struct/compiler"
|
2
4
|
|
3
5
|
module Dry
|
4
6
|
class Struct
|
5
7
|
# @private
|
6
|
-
class StructBuilder <
|
8
|
+
class StructBuilder < Compiler
|
7
9
|
attr_reader :struct
|
8
10
|
|
9
11
|
def initialize(struct)
|
10
|
-
super(
|
12
|
+
super(Types)
|
11
13
|
@struct = struct
|
12
14
|
end
|
13
15
|
|
14
16
|
# @param [Symbol|String] attr_name the name of the nested type
|
15
|
-
# @param [Dry::Struct,Dry::Types::Type::Array] type the superclass of the nested struct
|
17
|
+
# @param [Dry::Struct,Dry::Types::Type::Array,Undefined] type the superclass of the nested struct
|
16
18
|
# @yield the body of the nested struct
|
17
19
|
def call(attr_name, type, &block)
|
18
20
|
const_name = const_name(type, attr_name)
|
19
21
|
check_name(const_name)
|
20
22
|
|
21
|
-
|
23
|
+
builder = self
|
24
|
+
parent = parent(type)
|
25
|
+
|
26
|
+
new_type = ::Class.new(Undefined.default(parent, struct.abstract_class)) do
|
27
|
+
if Undefined.equal?(parent)
|
28
|
+
schema builder.struct.schema.clear
|
29
|
+
end
|
30
|
+
|
31
|
+
class_exec(&block)
|
32
|
+
end
|
33
|
+
|
22
34
|
struct.const_set(const_name, new_type)
|
23
35
|
|
24
36
|
if array?(type)
|
25
37
|
type.of(new_type)
|
38
|
+
elsif optional?(type)
|
39
|
+
new_type.optional
|
26
40
|
else
|
27
41
|
new_type
|
28
42
|
end
|
@@ -30,37 +44,46 @@ module Dry
|
|
30
44
|
|
31
45
|
private
|
32
46
|
|
47
|
+
def type?(type)
|
48
|
+
type.is_a?(Types::Type)
|
49
|
+
end
|
50
|
+
|
33
51
|
def array?(type)
|
34
|
-
type
|
52
|
+
type?(type) && !type.optional? && type.primitive.equal?(::Array)
|
53
|
+
end
|
54
|
+
|
55
|
+
def optional?(type)
|
56
|
+
type?(type) && type.optional?
|
35
57
|
end
|
36
58
|
|
37
59
|
def parent(type)
|
38
60
|
if array?(type)
|
39
61
|
visit(type.to_ast)
|
62
|
+
elsif optional?(type)
|
63
|
+
type.right
|
40
64
|
else
|
41
|
-
type
|
65
|
+
type
|
42
66
|
end
|
43
67
|
end
|
44
68
|
|
45
|
-
def default_superclass
|
46
|
-
struct < Value ? Value : Struct
|
47
|
-
end
|
48
|
-
|
49
69
|
def const_name(type, attr_name)
|
50
|
-
snake_name =
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
70
|
+
snake_name =
|
71
|
+
if array?(type)
|
72
|
+
Core::Inflector.singularize(attr_name)
|
73
|
+
else
|
74
|
+
attr_name
|
75
|
+
end
|
76
|
+
|
77
|
+
Core::Inflector.camelize(snake_name)
|
57
78
|
end
|
58
79
|
|
59
80
|
def check_name(name)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
81
|
+
if struct.const_defined?(name, false)
|
82
|
+
raise(
|
83
|
+
Error,
|
84
|
+
"Can't create nested attribute - `#{struct}::#{name}` already defined"
|
85
|
+
)
|
86
|
+
end
|
64
87
|
end
|
65
88
|
|
66
89
|
def visit_constrained(node)
|
@@ -70,11 +93,11 @@ module Dry
|
|
70
93
|
|
71
94
|
def visit_array(node)
|
72
95
|
member, * = node
|
73
|
-
member
|
96
|
+
visit(member)
|
74
97
|
end
|
75
98
|
|
76
|
-
def
|
77
|
-
|
99
|
+
def visit_nominal(*)
|
100
|
+
Undefined
|
78
101
|
end
|
79
102
|
|
80
103
|
def visit_constructor(node)
|
data/lib/dry/struct/sum.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "dry/types/sum"
|
4
|
+
require "dry/types/printer"
|
2
5
|
|
3
6
|
module Dry
|
4
7
|
class Struct
|
@@ -6,6 +9,12 @@ module Dry
|
|
6
9
|
# As opposed to Dry::Types::Sum::Constrained
|
7
10
|
# this type tries no to coerce data first.
|
8
11
|
class Sum < Dry::Types::Sum::Constrained
|
12
|
+
def call(input)
|
13
|
+
left.try_struct(input) do
|
14
|
+
right.try_struct(input) { super }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
9
18
|
# @param [Hash{Symbol => Object},Dry::Struct] input
|
10
19
|
# @yieldparam [Dry::Types::Result::Failure] failure
|
11
20
|
# @yieldreturn [Dry::Types::ResultResult]
|
@@ -23,12 +32,17 @@ module Dry
|
|
23
32
|
# @return [Dry::Types::Sum]
|
24
33
|
def |(type)
|
25
34
|
if type.is_a?(Class) && type <= Struct || type.is_a?(Sum)
|
26
|
-
|
35
|
+
Sum.new(self, type)
|
27
36
|
else
|
28
37
|
super
|
29
38
|
end
|
30
39
|
end
|
31
40
|
|
41
|
+
# @return [boolean]
|
42
|
+
def ===(value)
|
43
|
+
left === value || right === value
|
44
|
+
end
|
45
|
+
|
32
46
|
protected
|
33
47
|
|
34
48
|
# @private
|
data/lib/dry/struct/value.rb
CHANGED
@@ -1,14 +1,19 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ice_nine"
|
4
|
+
require "dry/core/deprecations"
|
2
5
|
|
3
6
|
module Dry
|
4
7
|
class Struct
|
8
|
+
extend Core::Deprecations[:'dry-struct']
|
9
|
+
|
5
10
|
# {Value} objects behave like {Struct}s but *deeply frozen*
|
6
11
|
# using [`ice_nine`](https://github.com/dkubb/ice_nine)
|
7
12
|
#
|
8
13
|
# @example
|
9
14
|
# class Location < Dry::Struct::Value
|
10
|
-
# attribute :lat, Types::
|
11
|
-
# attribute :lng, Types::
|
15
|
+
# attribute :lat, Types::Float
|
16
|
+
# attribute :lng, Types::Float
|
12
17
|
# end
|
13
18
|
#
|
14
19
|
# loc1 = Location.new(lat: 1.23, lng: 4.56)
|
@@ -20,12 +25,16 @@ module Dry
|
|
20
25
|
#
|
21
26
|
# @see https://github.com/dkubb/ice_nine
|
22
27
|
class Value < self
|
28
|
+
abstract
|
29
|
+
|
23
30
|
# @param (see ClassInterface#new)
|
24
31
|
# @return [Value]
|
25
32
|
# @see https://github.com/dkubb/ice_nine
|
26
33
|
def self.new(*)
|
27
|
-
IceNine.deep_freeze(super)
|
34
|
+
::IceNine.deep_freeze(super)
|
28
35
|
end
|
29
36
|
end
|
37
|
+
|
38
|
+
deprecate_constant :Value
|
30
39
|
end
|
31
40
|
end
|
data/lib/dry/struct/version.rb
CHANGED
data/lib/dry/struct.rb
CHANGED
@@ -1,13 +1,16 @@
|
|
1
|
-
|
2
|
-
require 'dry-equalizer'
|
3
|
-
require 'dry/core/extensions'
|
4
|
-
require 'dry/core/constants'
|
1
|
+
# frozen_string_literal: true
|
5
2
|
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
3
|
+
require "dry/types"
|
4
|
+
require "dry/core/equalizer"
|
5
|
+
require "dry/core/extensions"
|
6
|
+
require "dry/core/constants"
|
7
|
+
require "dry/core/deprecations"
|
8
|
+
|
9
|
+
require "dry/struct/version"
|
10
|
+
require "dry/struct/errors"
|
11
|
+
require "dry/struct/class_interface"
|
12
|
+
require "dry/struct/hashify"
|
13
|
+
require "dry/struct/struct_builder"
|
11
14
|
|
12
15
|
module Dry
|
13
16
|
# Constructor method for easily creating a {Dry::Struct}.
|
@@ -16,21 +19,21 @@ module Dry
|
|
16
19
|
# require 'dry-struct'
|
17
20
|
#
|
18
21
|
# module Types
|
19
|
-
# include Dry
|
22
|
+
# include Dry.Types()
|
20
23
|
# end
|
21
24
|
#
|
22
|
-
# Person = Dry.Struct(name: Types::
|
25
|
+
# Person = Dry.Struct(name: Types::String, age: Types::Integer)
|
23
26
|
# matz = Person.new(name: "Matz", age: 52)
|
24
27
|
# matz.name #=> "Matz"
|
25
28
|
# matz.age #=> 52
|
26
29
|
#
|
27
|
-
# Test = Dry.Struct(expected: Types::
|
30
|
+
# Test = Dry.Struct(expected: Types::String) { schema(schema.strict) }
|
28
31
|
# Test[expected: "foo", unexpected: "bar"]
|
29
32
|
# #=> Dry::Struct::Error: [Test.new] unexpected keys [:unexpected] in Hash input
|
30
33
|
def self.Struct(attributes = Dry::Core::Constants::EMPTY_HASH, &block)
|
31
34
|
Class.new(Dry::Struct) do
|
32
35
|
attributes.each { |a, type| attribute a, type }
|
33
|
-
|
36
|
+
module_eval(&block) if block
|
34
37
|
end
|
35
38
|
end
|
36
39
|
|
@@ -60,12 +63,12 @@ module Dry
|
|
60
63
|
# require 'dry-struct'
|
61
64
|
#
|
62
65
|
# module Types
|
63
|
-
# include Dry
|
66
|
+
# include Dry.Types()
|
64
67
|
# end
|
65
68
|
#
|
66
69
|
# class Book < Dry::Struct
|
67
|
-
# attribute :title, Types::
|
68
|
-
# attribute :subtitle, Types::
|
70
|
+
# attribute :title, Types::String
|
71
|
+
# attribute :subtitle, Types::String.optional
|
69
72
|
# end
|
70
73
|
#
|
71
74
|
# rom_n_roda = Book.new(
|
@@ -82,18 +85,27 @@ module Dry
|
|
82
85
|
# refactoring.title #=> 'Refactoring'
|
83
86
|
# refactoring.subtitle #=> 'Improving the Design of Existing Code'
|
84
87
|
class Struct
|
85
|
-
extend
|
86
|
-
include
|
88
|
+
extend Core::Extensions
|
89
|
+
include Core::Constants
|
87
90
|
extend ClassInterface
|
91
|
+
extend Core::Deprecations[:'dry-struct']
|
92
|
+
|
93
|
+
class << self
|
94
|
+
# override `Dry::Types::Builder#prepend`
|
95
|
+
define_method(:prepend, ::Module.method(:prepend))
|
96
|
+
end
|
97
|
+
|
98
|
+
autoload :Value, "dry/struct/value"
|
88
99
|
|
89
|
-
include Dry::Equalizer(:__attributes__)
|
100
|
+
include ::Dry::Equalizer(:__attributes__, inspect: false, immutable: true)
|
90
101
|
|
91
102
|
# {Dry::Types::Hash::Schema} subclass with specific behaviour defined for
|
92
103
|
# @return [Dry::Types::Hash::Schema]
|
93
|
-
defines :
|
94
|
-
|
104
|
+
defines :schema
|
105
|
+
schema Types["coercible.hash"].schema(EMPTY_HASH)
|
95
106
|
|
96
|
-
|
107
|
+
defines :abstract_class
|
108
|
+
abstract
|
97
109
|
|
98
110
|
# @!attribute [Hash{Symbol => Object}] attributes
|
99
111
|
attr_reader :attributes
|
@@ -111,8 +123,8 @@ module Dry
|
|
111
123
|
#
|
112
124
|
# @example
|
113
125
|
# class Book < Dry::Struct
|
114
|
-
# attribute :title, Types::
|
115
|
-
# attribute :subtitle, Types::
|
126
|
+
# attribute :title, Types::String
|
127
|
+
# attribute :subtitle, Types::String.optional
|
116
128
|
# end
|
117
129
|
#
|
118
130
|
# rom_n_roda = Book.new(
|
@@ -122,7 +134,7 @@ module Dry
|
|
122
134
|
# rom_n_roda[:title] #=> 'Web Development with ROM and Roda'
|
123
135
|
# rom_n_roda[:subtitle] #=> nil
|
124
136
|
def [](name)
|
125
|
-
@attributes.fetch(name) { raise MissingAttributeError
|
137
|
+
@attributes.fetch(name) { raise MissingAttributeError, name }
|
126
138
|
end
|
127
139
|
|
128
140
|
# Converts the {Dry::Struct} to a hash with keys representing
|
@@ -132,8 +144,8 @@ module Dry
|
|
132
144
|
#
|
133
145
|
# @example
|
134
146
|
# class Book < Dry::Struct
|
135
|
-
# attribute :title, Types::
|
136
|
-
# attribute :subtitle, Types::
|
147
|
+
# attribute :title, Types::String
|
148
|
+
# attribute :subtitle, Types::String.optional
|
137
149
|
# end
|
138
150
|
#
|
139
151
|
# rom_n_roda = Book.new(
|
@@ -142,12 +154,13 @@ module Dry
|
|
142
154
|
# )
|
143
155
|
# rom_n_roda.to_hash
|
144
156
|
# #=> {title: 'Web Development with ROM and Roda', subtitle: nil}
|
145
|
-
def
|
146
|
-
self.class.schema.
|
147
|
-
result[key] = Hashify[self[key]] if attributes.key?(key)
|
157
|
+
def to_h
|
158
|
+
self.class.schema.each_with_object({}) do |key, result|
|
159
|
+
result[key.name] = Hashify[self[key.name]] if attributes.key?(key.name)
|
148
160
|
end
|
149
161
|
end
|
150
|
-
alias_method :
|
162
|
+
alias_method :to_hash, :to_h
|
163
|
+
# deprecate :to_hash, :to_h, message: "Implicit convertion structs to hashes is deprecated. Use .to_h"
|
151
164
|
|
152
165
|
# Create a copy of {Dry::Struct} with overriden attributes
|
153
166
|
#
|
@@ -157,8 +170,8 @@ module Dry
|
|
157
170
|
#
|
158
171
|
# @example
|
159
172
|
# class Book < Dry::Struct
|
160
|
-
# attribute :title, Types::
|
161
|
-
# attribute :subtitle, Types::
|
173
|
+
# attribute :title, Types::String
|
174
|
+
# attribute :subtitle, Types::String.optional
|
162
175
|
# end
|
163
176
|
#
|
164
177
|
# rom_n_roda = Book.new(
|
@@ -170,7 +183,10 @@ module Dry
|
|
170
183
|
# rom_n_roda.new(subtitle: '3rd edition')
|
171
184
|
# #=> #<Book title="Web Development with ROM and Roda" subtitle="3rd edition">
|
172
185
|
def new(changeset)
|
173
|
-
self.class
|
186
|
+
new_attributes = self.class.schema.apply(changeset, skip_missing: true, resolve_defaults: false)
|
187
|
+
self.class.load(__attributes__.merge(new_attributes))
|
188
|
+
rescue Types::SchemaError, Types::MissingKeyError, Types::UnknownKeysError => e
|
189
|
+
raise Error, "[#{self}.new] #{e}"
|
174
190
|
end
|
175
191
|
alias_method :__new__, :new
|
176
192
|
|
@@ -178,10 +194,19 @@ module Dry
|
|
178
194
|
def inspect
|
179
195
|
klass = self.class
|
180
196
|
attrs = klass.attribute_names.map { |key| " #{key}=#{@attributes[key].inspect}" }.join
|
181
|
-
"#<#{
|
197
|
+
"#<#{klass.name || klass.inspect}#{attrs}>"
|
198
|
+
end
|
199
|
+
|
200
|
+
if RUBY_VERSION >= "2.7"
|
201
|
+
# Pattern matching support
|
202
|
+
#
|
203
|
+
# @api private
|
204
|
+
def deconstruct_keys(_keys)
|
205
|
+
attributes
|
206
|
+
end
|
182
207
|
end
|
183
208
|
end
|
184
209
|
end
|
185
210
|
|
186
|
-
require
|
187
|
-
require
|
211
|
+
require "dry/struct/extensions"
|
212
|
+
require "dry/struct/printer"
|
data/lib/dry-struct.rb
CHANGED
metadata
CHANGED
@@ -1,63 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.4.0
|
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-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: dry-
|
14
|
+
name: dry-core
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
20
|
-
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0.2'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: dry-types
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
19
|
+
version: '0.5'
|
20
|
+
- - ">="
|
32
21
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
22
|
+
version: '0.5'
|
34
23
|
type: :runtime
|
35
24
|
prerelease: false
|
36
25
|
version_requirements: !ruby/object:Gem::Requirement
|
37
26
|
requirements:
|
38
27
|
- - "~>"
|
39
28
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
29
|
+
version: '0.5'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.5'
|
41
33
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: dry-
|
34
|
+
name: dry-types
|
43
35
|
requirement: !ruby/object:Gem::Requirement
|
44
36
|
requirements:
|
45
37
|
- - "~>"
|
46
38
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 0.4.3
|
39
|
+
version: '1.5'
|
51
40
|
type: :runtime
|
52
41
|
prerelease: false
|
53
42
|
version_requirements: !ruby/object:Gem::Requirement
|
54
43
|
requirements:
|
55
44
|
- - "~>"
|
56
45
|
- !ruby/object:Gem::Version
|
57
|
-
version: '
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 0.4.3
|
46
|
+
version: '1.5'
|
61
47
|
- !ruby/object:Gem::Dependency
|
62
48
|
name: ice_nine
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,100 +62,91 @@ dependencies:
|
|
76
62
|
name: bundler
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
78
64
|
requirements:
|
79
|
-
- - "
|
65
|
+
- - ">="
|
80
66
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
67
|
+
version: '0'
|
82
68
|
type: :development
|
83
69
|
prerelease: false
|
84
70
|
version_requirements: !ruby/object:Gem::Requirement
|
85
71
|
requirements:
|
86
|
-
- - "
|
72
|
+
- - ">="
|
87
73
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
74
|
+
version: '0'
|
89
75
|
- !ruby/object:Gem::Dependency
|
90
76
|
name: rake
|
91
77
|
requirement: !ruby/object:Gem::Requirement
|
92
78
|
requirements:
|
93
|
-
- - "
|
79
|
+
- - ">="
|
94
80
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
81
|
+
version: '0'
|
96
82
|
type: :development
|
97
83
|
prerelease: false
|
98
84
|
version_requirements: !ruby/object:Gem::Requirement
|
99
85
|
requirements:
|
100
|
-
- - "
|
86
|
+
- - ">="
|
101
87
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
88
|
+
version: '0'
|
103
89
|
- !ruby/object:Gem::Dependency
|
104
90
|
name: rspec
|
105
91
|
requirement: !ruby/object:Gem::Requirement
|
106
92
|
requirements:
|
107
|
-
- - "
|
93
|
+
- - ">="
|
108
94
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
95
|
+
version: '0'
|
110
96
|
type: :development
|
111
97
|
prerelease: false
|
112
98
|
version_requirements: !ruby/object:Gem::Requirement
|
113
99
|
requirements:
|
114
|
-
- - "
|
100
|
+
- - ">="
|
115
101
|
- !ruby/object:Gem::Version
|
116
|
-
version: '
|
102
|
+
version: '0'
|
117
103
|
- !ruby/object:Gem::Dependency
|
118
104
|
name: yard
|
119
105
|
requirement: !ruby/object:Gem::Requirement
|
120
106
|
requirements:
|
121
|
-
- - "
|
107
|
+
- - ">="
|
122
108
|
- !ruby/object:Gem::Version
|
123
|
-
version: 0
|
109
|
+
version: '0'
|
124
110
|
type: :development
|
125
111
|
prerelease: false
|
126
112
|
version_requirements: !ruby/object:Gem::Requirement
|
127
113
|
requirements:
|
128
|
-
- - "
|
114
|
+
- - ">="
|
129
115
|
- !ruby/object:Gem::Version
|
130
|
-
version: 0
|
131
|
-
description: Typed structs and value objects
|
116
|
+
version: '0'
|
117
|
+
description: Typed structs and value objects
|
132
118
|
email:
|
133
119
|
- piotr.solnica@gmail.com
|
134
120
|
executables: []
|
135
121
|
extensions: []
|
136
122
|
extra_rdoc_files: []
|
137
123
|
files:
|
138
|
-
- ".gitignore"
|
139
|
-
- ".rspec"
|
140
|
-
- ".travis.yml"
|
141
|
-
- ".yardopts"
|
142
124
|
- CHANGELOG.md
|
143
|
-
- CONTRIBUTING.md
|
144
|
-
- Gemfile
|
145
125
|
- LICENSE
|
146
126
|
- README.md
|
147
|
-
- Rakefile
|
148
|
-
- benchmarks/basic.rb
|
149
|
-
- benchmarks/constrained.rb
|
150
|
-
- bin/console
|
151
|
-
- bin/setup
|
152
127
|
- dry-struct.gemspec
|
153
128
|
- lib/dry-struct.rb
|
154
129
|
- lib/dry/struct.rb
|
155
130
|
- lib/dry/struct/class_interface.rb
|
131
|
+
- lib/dry/struct/compiler.rb
|
156
132
|
- lib/dry/struct/constructor.rb
|
157
133
|
- lib/dry/struct/errors.rb
|
158
134
|
- lib/dry/struct/extensions.rb
|
159
135
|
- lib/dry/struct/extensions/pretty_print.rb
|
160
136
|
- lib/dry/struct/hashify.rb
|
137
|
+
- lib/dry/struct/printer.rb
|
161
138
|
- lib/dry/struct/struct_builder.rb
|
162
139
|
- lib/dry/struct/sum.rb
|
163
140
|
- lib/dry/struct/value.rb
|
164
141
|
- lib/dry/struct/version.rb
|
165
|
-
-
|
166
|
-
homepage: https://github.com/dry-rb/dry-struct
|
142
|
+
homepage: https://dry-rb.org/gems/dry-struct
|
167
143
|
licenses:
|
168
144
|
- MIT
|
169
145
|
metadata:
|
170
146
|
allowed_push_host: https://rubygems.org
|
171
147
|
changelog_uri: https://github.com/dry-rb/dry-struct/blob/master/CHANGELOG.md
|
172
148
|
source_code_uri: https://github.com/dry-rb/dry-struct
|
149
|
+
bug_tracker_uri: https://github.com/dry-rb/dry-struct/issues
|
173
150
|
post_install_message:
|
174
151
|
rdoc_options: []
|
175
152
|
require_paths:
|
@@ -178,16 +155,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
155
|
requirements:
|
179
156
|
- - ">="
|
180
157
|
- !ruby/object:Gem::Version
|
181
|
-
version:
|
158
|
+
version: 2.5.0
|
182
159
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
160
|
requirements:
|
184
161
|
- - ">="
|
185
162
|
- !ruby/object:Gem::Version
|
186
163
|
version: '0'
|
187
164
|
requirements: []
|
188
|
-
|
189
|
-
rubygems_version: 2.7.6
|
165
|
+
rubygems_version: 3.1.4
|
190
166
|
signing_key:
|
191
167
|
specification_version: 4
|
192
|
-
summary: Typed structs and value objects
|
168
|
+
summary: Typed structs and value objects
|
193
169
|
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED