dry-initializer 3.0.2 → 3.1.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 +260 -241
- data/LICENSE +1 -1
- data/README.md +18 -77
- data/dry-initializer.gemspec +34 -19
- data/lib/dry/initializer/builders/attribute.rb +78 -69
- data/lib/dry/initializer/builders/initializer.rb +56 -58
- data/lib/dry/initializer/builders/reader.rb +55 -47
- data/lib/dry/initializer/builders/signature.rb +29 -23
- data/lib/dry/initializer/builders.rb +9 -5
- data/lib/dry/initializer/config.rb +162 -158
- data/lib/dry/initializer/definition.rb +58 -54
- data/lib/dry/initializer/dispatchers/build_nested_type.rb +54 -40
- data/lib/dry/initializer/dispatchers/check_type.rb +45 -39
- data/lib/dry/initializer/dispatchers/prepare_default.rb +32 -25
- data/lib/dry/initializer/dispatchers/prepare_ivar.rb +13 -6
- data/lib/dry/initializer/dispatchers/prepare_optional.rb +14 -7
- data/lib/dry/initializer/dispatchers/prepare_reader.rb +29 -22
- data/lib/dry/initializer/dispatchers/prepare_source.rb +12 -5
- data/lib/dry/initializer/dispatchers/prepare_target.rb +44 -37
- data/lib/dry/initializer/dispatchers/unwrap_type.rb +21 -10
- data/lib/dry/initializer/dispatchers/wrap_type.rb +25 -17
- data/lib/dry/initializer/dispatchers.rb +48 -43
- data/lib/dry/initializer/dsl.rb +42 -34
- data/lib/dry/initializer/mixin/local.rb +19 -13
- data/lib/dry/initializer/mixin/root.rb +12 -7
- data/lib/dry/initializer/mixin.rb +17 -12
- data/lib/dry/initializer/struct.rb +34 -29
- data/lib/dry/initializer/undefined.rb +7 -1
- data/lib/dry/initializer/version.rb +7 -0
- data/lib/dry/initializer.rb +2 -0
- data/lib/dry-initializer.rb +2 -0
- data/lib/tasks/benchmark.rake +2 -0
- data/lib/tasks/profile.rake +4 -0
- metadata +25 -125
- 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 -34
- data/.github/ISSUE_TEMPLATE/---feature-request.md +0 -18
- data/.github/workflows/custom_ci.yml +0 -74
- data/.github/workflows/docsite.yml +0 -34
- data/.github/workflows/sync_configs.yml +0 -34
- data/.gitignore +0 -12
- data/.rspec +0 -4
- data/.rubocop.yml +0 -89
- data/CODE_OF_CONDUCT.md +0 -13
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -38
- data/Guardfile +0 -5
- data/LICENSE.txt +0 -21
- data/Rakefile +0 -8
- data/benchmarks/compare_several_defaults.rb +0 -82
- data/benchmarks/plain_options.rb +0 -63
- data/benchmarks/plain_params.rb +0 -84
- data/benchmarks/with_coercion.rb +0 -71
- data/benchmarks/with_defaults.rb +0 -66
- data/benchmarks/with_defaults_and_coercion.rb +0 -59
- data/docsite/source/attributes.html.md +0 -106
- data/docsite/source/container-version.html.md +0 -39
- data/docsite/source/index.html.md +0 -43
- data/docsite/source/inheritance.html.md +0 -43
- data/docsite/source/optionals-and-defaults.html.md +0 -130
- data/docsite/source/options-tolerance.html.md +0 -27
- data/docsite/source/params-and-options.html.md +0 -74
- data/docsite/source/rails-support.html.md +0 -101
- data/docsite/source/readers.html.md +0 -43
- data/docsite/source/skip-undefined.html.md +0 -59
- data/docsite/source/type-constraints.html.md +0 -160
- data/spec/attributes_spec.rb +0 -38
- data/spec/coercion_of_nil_spec.rb +0 -25
- data/spec/custom_dispatchers_spec.rb +0 -35
- data/spec/custom_initializer_spec.rb +0 -30
- data/spec/default_values_spec.rb +0 -83
- data/spec/definition_spec.rb +0 -111
- data/spec/invalid_default_spec.rb +0 -13
- data/spec/list_type_spec.rb +0 -32
- data/spec/missed_default_spec.rb +0 -14
- data/spec/nested_type_spec.rb +0 -48
- data/spec/optional_spec.rb +0 -71
- data/spec/options_tolerance_spec.rb +0 -11
- data/spec/public_attributes_utility_spec.rb +0 -22
- data/spec/reader_spec.rb +0 -87
- data/spec/repetitive_definitions_spec.rb +0 -69
- data/spec/several_assignments_spec.rb +0 -41
- data/spec/spec_helper.rb +0 -29
- data/spec/subclassing_spec.rb +0 -49
- data/spec/type_argument_spec.rb +0 -35
- data/spec/type_constraint_spec.rb +0 -78
- data/spec/value_coercion_via_dry_types_spec.rb +0 -29
data/lib/dry/initializer/dsl.rb
CHANGED
@@ -1,43 +1,51 @@
|
|
1
|
-
|
2
|
-
# Module-level DSL
|
3
|
-
module DSL
|
4
|
-
# Setting for null (undefined value)
|
5
|
-
# @return [nil, Dry::Initializer::UNDEFINED]
|
6
|
-
attr_reader :null
|
1
|
+
# frozen_string_literal: true
|
7
2
|
|
8
|
-
|
9
|
-
|
10
|
-
#
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
3
|
+
module Dry
|
4
|
+
module Initializer
|
5
|
+
# Module-level DSL
|
6
|
+
module DSL
|
7
|
+
# Setting for null (undefined value)
|
8
|
+
# @return [nil, Dry::Initializer::UNDEFINED]
|
9
|
+
attr_reader :null
|
10
|
+
|
11
|
+
# Returns a version of the module with custom settings
|
12
|
+
# @option settings [Boolean] :undefined
|
13
|
+
# If unassigned params and options should be treated different from nil
|
14
|
+
# @return [Dry::Initializer]
|
15
|
+
def [](undefined: true, **)
|
16
|
+
null = undefined == false ? nil : UNDEFINED
|
17
|
+
Module.new.tap do |mod|
|
18
|
+
mod.extend DSL
|
19
|
+
mod.include self
|
20
|
+
mod.send(:instance_variable_set, :@null, null)
|
21
|
+
end
|
18
22
|
end
|
19
|
-
end
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
# Returns mixin module to be included to target class by hand
|
25
|
+
# @return [Module]
|
26
|
+
# @yield proc defining params and options
|
27
|
+
def define(procedure = nil, &block)
|
28
|
+
config = Config.new(null: null)
|
29
|
+
config.instance_exec(&(procedure || block))
|
30
|
+
config.mixin.include Mixin::Root
|
31
|
+
config.mixin
|
32
|
+
end
|
30
33
|
|
31
|
-
|
34
|
+
private
|
32
35
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
36
|
+
def extended(klass)
|
37
|
+
config = Config.new(klass, null: null)
|
38
|
+
klass.send :instance_variable_set, :@dry_initializer, config
|
39
|
+
klass.include Mixin::Root
|
40
|
+
end
|
38
41
|
|
39
|
-
|
40
|
-
|
42
|
+
class << self
|
43
|
+
private
|
44
|
+
|
45
|
+
def extended(mod)
|
46
|
+
mod.instance_variable_set :@null, UNDEFINED
|
47
|
+
end
|
48
|
+
end
|
41
49
|
end
|
42
50
|
end
|
43
51
|
end
|
@@ -1,19 +1,25 @@
|
|
1
|
-
|
2
|
-
# @private
|
3
|
-
module Local
|
4
|
-
attr_reader :klass
|
1
|
+
# frozen_string_literal: true
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
module Dry
|
4
|
+
module Initializer
|
5
|
+
module Mixin
|
6
|
+
# @private
|
7
|
+
module Local
|
8
|
+
attr_reader :klass
|
9
|
+
|
10
|
+
def inspect
|
11
|
+
"Dry::Initializer::Mixin::Local[#{klass}]"
|
12
|
+
end
|
13
|
+
alias_method :to_s, :inspect
|
14
|
+
alias_method :to_str, :inspect
|
11
15
|
|
12
|
-
|
16
|
+
private
|
13
17
|
|
14
|
-
|
15
|
-
|
16
|
-
|
18
|
+
def included(klass)
|
19
|
+
@klass = klass
|
20
|
+
super
|
21
|
+
end
|
22
|
+
end
|
17
23
|
end
|
18
24
|
end
|
19
25
|
end
|
@@ -1,11 +1,16 @@
|
|
1
|
-
|
2
|
-
# @private
|
3
|
-
module Root
|
4
|
-
private
|
1
|
+
# frozen_string_literal: true
|
5
2
|
|
6
|
-
|
7
|
-
|
3
|
+
module Dry
|
4
|
+
module Initializer
|
5
|
+
module Mixin
|
6
|
+
# @private
|
7
|
+
module Root
|
8
|
+
private
|
9
|
+
|
10
|
+
def initialize(...)
|
11
|
+
__dry_initializer_initialize__(...)
|
12
|
+
end
|
13
|
+
end
|
8
14
|
end
|
9
|
-
ruby2_keywords(:initialize) if respond_to?(:ruby2_keywords, true)
|
10
15
|
end
|
11
16
|
end
|
@@ -1,15 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dry
|
4
|
+
module Initializer
|
5
|
+
# @private
|
6
|
+
module Mixin
|
7
|
+
extend DSL # @deprecated
|
8
|
+
include Dry::Initializer # @deprecated
|
9
|
+
# @deprecated
|
10
|
+
def self.extended(klass)
|
11
|
+
warn "[DEPRECATED] Use Dry::Initializer instead of its alias" \
|
12
|
+
" Dry::Initializer::Mixin. The later will be removed in v2.1.0"
|
13
|
+
super
|
14
|
+
end
|
11
15
|
|
12
|
-
|
13
|
-
|
16
|
+
require_relative "mixin/root"
|
17
|
+
require_relative "mixin/local"
|
18
|
+
end
|
14
19
|
end
|
15
20
|
end
|
@@ -1,39 +1,44 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
# The nested structure that takes nested hashes with indifferent access
|
3
4
|
#
|
4
|
-
|
5
|
-
|
5
|
+
module Dry
|
6
|
+
module Initializer
|
7
|
+
class Struct
|
8
|
+
extend ::Dry::Initializer
|
6
9
|
|
7
|
-
|
8
|
-
|
10
|
+
class << self
|
11
|
+
undef_method :param
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
def new(options)
|
14
|
+
super(**Hash(options).each_with_object({}) { |(k, v), h| h[k.to_sym] = v })
|
15
|
+
end
|
16
|
+
alias_method :call, :new
|
17
|
+
end
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
#
|
20
|
+
# Represents event data as a nested hash with deeply stringified keys
|
21
|
+
# @return [Hash<String, ...>]
|
22
|
+
#
|
23
|
+
def to_h
|
24
|
+
self
|
25
|
+
.class
|
26
|
+
.dry_initializer
|
27
|
+
.attributes(self)
|
28
|
+
.each_with_object({}) { |(k, v), h| h[k.to_s] = __hashify(v) }
|
29
|
+
end
|
27
30
|
|
28
|
-
|
31
|
+
private
|
29
32
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
def __hashify(value)
|
34
|
+
case value
|
35
|
+
when Hash
|
36
|
+
value.each_with_object({}) { |(k, v), obj| obj[k.to_s] = __hashify(v) }
|
37
|
+
when Array then value.map { |v| __hashify(v) }
|
38
|
+
when Dry::Initializer::Struct then value.to_h
|
39
|
+
else value
|
40
|
+
end
|
41
|
+
end
|
37
42
|
end
|
38
43
|
end
|
39
44
|
end
|
data/lib/dry/initializer.rb
CHANGED
data/lib/dry-initializer.rb
CHANGED
data/lib/tasks/benchmark.rake
CHANGED
data/lib/tasks/profile.rake
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# rubocop: disable Lint/ConstantDefinitionInBlock
|
1
4
|
namespace :profile do
|
2
5
|
def profile(name, execution, &definition)
|
3
6
|
require "dry-initializer"
|
@@ -76,3 +79,4 @@ task profile: %i[
|
|
76
79
|
profile:coercion
|
77
80
|
profile:default_coercion
|
78
81
|
]
|
82
|
+
# rubocop: enable Lint/ConstantDefinitionInBlock
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-initializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Kochnev (marshall-lee)
|
@@ -9,109 +9,46 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: rspec
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '3.0'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - "~>"
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '3.0'
|
28
14
|
- !ruby/object:Gem::Dependency
|
29
15
|
name: rake
|
30
16
|
requirement: !ruby/object:Gem::Requirement
|
31
17
|
requirements:
|
32
|
-
- - "
|
18
|
+
- - ">="
|
33
19
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
20
|
+
version: '0'
|
35
21
|
type: :development
|
36
22
|
prerelease: false
|
37
23
|
version_requirements: !ruby/object:Gem::Requirement
|
38
24
|
requirements:
|
39
|
-
- - "
|
25
|
+
- - ">="
|
40
26
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
27
|
+
version: '0'
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - ">"
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: 0.5.1
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - ">"
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: 0.5.1
|
56
|
-
- !ruby/object:Gem::Dependency
|
57
|
-
name: rubocop
|
29
|
+
name: rspec
|
58
30
|
requirement: !ruby/object:Gem::Requirement
|
59
31
|
requirements:
|
60
|
-
- - "
|
32
|
+
- - ">="
|
61
33
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0
|
34
|
+
version: '0'
|
63
35
|
type: :development
|
64
36
|
prerelease: false
|
65
37
|
version_requirements: !ruby/object:Gem::Requirement
|
66
38
|
requirements:
|
67
|
-
- - "
|
39
|
+
- - ">="
|
68
40
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0
|
70
|
-
description:
|
71
|
-
email:
|
41
|
+
version: '0'
|
42
|
+
description: DSL for declaring params and options of the initializer
|
43
|
+
email:
|
44
|
+
- andrew.kozin@gmail.com
|
72
45
|
executables: []
|
73
46
|
extensions: []
|
74
|
-
extra_rdoc_files:
|
75
|
-
- README.md
|
76
|
-
- LICENSE
|
77
|
-
- CHANGELOG.md
|
47
|
+
extra_rdoc_files: []
|
78
48
|
files:
|
79
|
-
- ".codeclimate.yml"
|
80
|
-
- ".github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md"
|
81
|
-
- ".github/ISSUE_TEMPLATE/---bug-report.md"
|
82
|
-
- ".github/ISSUE_TEMPLATE/---feature-request.md"
|
83
|
-
- ".github/workflows/custom_ci.yml"
|
84
|
-
- ".github/workflows/docsite.yml"
|
85
|
-
- ".github/workflows/sync_configs.yml"
|
86
|
-
- ".gitignore"
|
87
|
-
- ".rspec"
|
88
|
-
- ".rubocop.yml"
|
89
49
|
- CHANGELOG.md
|
90
|
-
- CODE_OF_CONDUCT.md
|
91
|
-
- CONTRIBUTING.md
|
92
|
-
- Gemfile
|
93
|
-
- Guardfile
|
94
50
|
- LICENSE
|
95
|
-
- LICENSE.txt
|
96
51
|
- README.md
|
97
|
-
- Rakefile
|
98
|
-
- benchmarks/compare_several_defaults.rb
|
99
|
-
- benchmarks/plain_options.rb
|
100
|
-
- benchmarks/plain_params.rb
|
101
|
-
- benchmarks/with_coercion.rb
|
102
|
-
- benchmarks/with_defaults.rb
|
103
|
-
- benchmarks/with_defaults_and_coercion.rb
|
104
|
-
- docsite/source/attributes.html.md
|
105
|
-
- docsite/source/container-version.html.md
|
106
|
-
- docsite/source/index.html.md
|
107
|
-
- docsite/source/inheritance.html.md
|
108
|
-
- docsite/source/optionals-and-defaults.html.md
|
109
|
-
- docsite/source/options-tolerance.html.md
|
110
|
-
- docsite/source/params-and-options.html.md
|
111
|
-
- docsite/source/rails-support.html.md
|
112
|
-
- docsite/source/readers.html.md
|
113
|
-
- docsite/source/skip-undefined.html.md
|
114
|
-
- docsite/source/type-constraints.html.md
|
115
52
|
- dry-initializer.gemspec
|
116
53
|
- lib/dry-initializer.rb
|
117
54
|
- lib/dry/initializer.rb
|
@@ -139,33 +76,17 @@ files:
|
|
139
76
|
- lib/dry/initializer/mixin/root.rb
|
140
77
|
- lib/dry/initializer/struct.rb
|
141
78
|
- lib/dry/initializer/undefined.rb
|
79
|
+
- lib/dry/initializer/version.rb
|
142
80
|
- lib/tasks/benchmark.rake
|
143
81
|
- lib/tasks/profile.rake
|
144
|
-
-
|
145
|
-
- spec/coercion_of_nil_spec.rb
|
146
|
-
- spec/custom_dispatchers_spec.rb
|
147
|
-
- spec/custom_initializer_spec.rb
|
148
|
-
- spec/default_values_spec.rb
|
149
|
-
- spec/definition_spec.rb
|
150
|
-
- spec/invalid_default_spec.rb
|
151
|
-
- spec/list_type_spec.rb
|
152
|
-
- spec/missed_default_spec.rb
|
153
|
-
- spec/nested_type_spec.rb
|
154
|
-
- spec/optional_spec.rb
|
155
|
-
- spec/options_tolerance_spec.rb
|
156
|
-
- spec/public_attributes_utility_spec.rb
|
157
|
-
- spec/reader_spec.rb
|
158
|
-
- spec/repetitive_definitions_spec.rb
|
159
|
-
- spec/several_assignments_spec.rb
|
160
|
-
- spec/spec_helper.rb
|
161
|
-
- spec/subclassing_spec.rb
|
162
|
-
- spec/type_argument_spec.rb
|
163
|
-
- spec/type_constraint_spec.rb
|
164
|
-
- spec/value_coercion_via_dry_types_spec.rb
|
165
|
-
homepage: https://github.com/dry-rb/dry-initializer
|
82
|
+
homepage: https://dry-rb.org/gems/dry-initializer
|
166
83
|
licenses:
|
167
84
|
- MIT
|
168
|
-
metadata:
|
85
|
+
metadata:
|
86
|
+
allowed_push_host: https://rubygems.org
|
87
|
+
changelog_uri: https://github.com/dry-rb/dry-initializer/blob/master/CHANGELOG.md
|
88
|
+
source_code_uri: https://github.com/dry-rb/dry-initializer
|
89
|
+
bug_tracker_uri: https://github.com/dry-rb/dry-initializer/issues
|
169
90
|
post_install_message:
|
170
91
|
rdoc_options: []
|
171
92
|
require_paths:
|
@@ -174,36 +95,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
174
95
|
requirements:
|
175
96
|
- - ">="
|
176
97
|
- !ruby/object:Gem::Version
|
177
|
-
version:
|
98
|
+
version: 2.7.0
|
178
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
100
|
requirements:
|
180
101
|
- - ">="
|
181
102
|
- !ruby/object:Gem::Version
|
182
103
|
version: '0'
|
183
104
|
requirements: []
|
184
|
-
rubygems_version: 3.
|
105
|
+
rubygems_version: 3.1.6
|
185
106
|
signing_key:
|
186
107
|
specification_version: 4
|
187
108
|
summary: DSL for declaring params and options of the initializer
|
188
|
-
test_files:
|
189
|
-
- spec/attributes_spec.rb
|
190
|
-
- spec/coercion_of_nil_spec.rb
|
191
|
-
- spec/custom_dispatchers_spec.rb
|
192
|
-
- spec/custom_initializer_spec.rb
|
193
|
-
- spec/default_values_spec.rb
|
194
|
-
- spec/definition_spec.rb
|
195
|
-
- spec/invalid_default_spec.rb
|
196
|
-
- spec/list_type_spec.rb
|
197
|
-
- spec/missed_default_spec.rb
|
198
|
-
- spec/nested_type_spec.rb
|
199
|
-
- spec/optional_spec.rb
|
200
|
-
- spec/options_tolerance_spec.rb
|
201
|
-
- spec/public_attributes_utility_spec.rb
|
202
|
-
- spec/reader_spec.rb
|
203
|
-
- spec/repetitive_definitions_spec.rb
|
204
|
-
- spec/several_assignments_spec.rb
|
205
|
-
- spec/spec_helper.rb
|
206
|
-
- spec/subclassing_spec.rb
|
207
|
-
- spec/type_argument_spec.rb
|
208
|
-
- spec/type_constraint_spec.rb
|
209
|
-
- spec/value_coercion_via_dry_types_spec.rb
|
109
|
+
test_files: []
|
data/.codeclimate.yml
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: "\U0001F41B Bug report"
|
3
|
-
about: See CONTRIBUTING.md for more information
|
4
|
-
title: ''
|
5
|
-
labels: bug
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
**Before you submit this: WE ONLY ACCEPT BUG REPORTS AND FEATURE REQUESTS**
|
11
|
-
|
12
|
-
For more information see [our contribution guidelines](https://github.com/rom-rb/rom/blob/master/CONTRIBUTING.md)
|
13
|
-
|
14
|
-
**Before you report**
|
15
|
-
|
16
|
-
:warning: If you have a problem related to a schema, please **report it under [dry-schema issues](https://github.com/dry-rb/dry-schema/issues/new?assignees=&labels=bug&template=---bug-report.md&title=)** instead.
|
17
|
-
|
18
|
-
**Describe the bug**
|
19
|
-
|
20
|
-
A clear and concise description of what the bug is.
|
21
|
-
|
22
|
-
**To Reproduce**
|
23
|
-
|
24
|
-
Provide detailed steps to reproduce, an executable script would be best.
|
25
|
-
|
26
|
-
**Expected behavior**
|
27
|
-
|
28
|
-
A clear and concise description of what you expected to happen.
|
29
|
-
|
30
|
-
**Your environment**
|
31
|
-
|
32
|
-
- Affects my production application: **YES/NO**
|
33
|
-
- Ruby version: ...
|
34
|
-
- OS: ...
|
@@ -1,18 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: "\U0001F6E0 Feature request"
|
3
|
-
about: See CONTRIBUTING.md for more information
|
4
|
-
title: ''
|
5
|
-
labels: feature
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
Summary of what the feature is supposed to do.
|
11
|
-
|
12
|
-
## Examples
|
13
|
-
|
14
|
-
Code examples showing how the feature could be used.
|
15
|
-
|
16
|
-
## Resources
|
17
|
-
|
18
|
-
Additional information, like a link to the discussion forum thread where the feature was discussed etc.
|
@@ -1,74 +0,0 @@
|
|
1
|
-
name: ci
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
paths:
|
6
|
-
- .github/workflows/custom_ci.yml
|
7
|
-
- lib/**
|
8
|
-
- spec/**
|
9
|
-
- Gemfile
|
10
|
-
- "*.gemspec"
|
11
|
-
|
12
|
-
jobs:
|
13
|
-
tests-mri:
|
14
|
-
runs-on: ubuntu-latest
|
15
|
-
strategy:
|
16
|
-
fail-fast: false
|
17
|
-
matrix:
|
18
|
-
ruby: ["2.6.x", "2.5.x", "2.4.x", "2.3.x"]
|
19
|
-
include:
|
20
|
-
- ruby: "2.6.x"
|
21
|
-
coverage: "true"
|
22
|
-
steps:
|
23
|
-
- uses: actions/checkout@v1
|
24
|
-
- name: Set up Ruby
|
25
|
-
uses: actions/setup-ruby@v1
|
26
|
-
with:
|
27
|
-
ruby-version: ${{matrix.ruby}}
|
28
|
-
- name: Download test reporter
|
29
|
-
if: "matrix.coverage == 'true'"
|
30
|
-
run: |
|
31
|
-
mkdir -p tmp/
|
32
|
-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
|
33
|
-
chmod +x ./tmp/cc-test-reporter
|
34
|
-
./tmp/cc-test-reporter before-build
|
35
|
-
- name: Run all tests
|
36
|
-
env:
|
37
|
-
CI: "true"
|
38
|
-
COVERAGE: ${{matrix.coverage}}
|
39
|
-
run: |
|
40
|
-
gem install bundler
|
41
|
-
bundle config set without 'tools docs benchmarks'
|
42
|
-
bundle install --jobs 4 --retry 3
|
43
|
-
bundle exec rake
|
44
|
-
- name: Send coverage results
|
45
|
-
if: "matrix.coverage == 'true'"
|
46
|
-
env:
|
47
|
-
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
|
48
|
-
GIT_COMMIT_SHA: ${{github.sha}}
|
49
|
-
GIT_BRANCH: ${{github.ref}}
|
50
|
-
GIT_COMMITTED_AT: ${{github.event.head_commit.timestamp}}
|
51
|
-
run: |
|
52
|
-
GIT_BRANCH=`ruby -e "puts ENV['GITHUB_REF'].split('/', 3).last"` \
|
53
|
-
GIT_COMMITTED_AT=`ruby -r time -e "puts Time.iso8601(ENV['GIT_COMMITTED_AT']).to_i"` \
|
54
|
-
./tmp/cc-test-reporter after-build
|
55
|
-
|
56
|
-
tests-others:
|
57
|
-
runs-on: ubuntu-latest
|
58
|
-
strategy:
|
59
|
-
fail-fast: false
|
60
|
-
matrix:
|
61
|
-
image: ["jruby:9.2.8", "ruby:rc"]
|
62
|
-
container:
|
63
|
-
image: ${{matrix.image}}
|
64
|
-
steps:
|
65
|
-
- uses: actions/checkout@v1
|
66
|
-
- name: Install git
|
67
|
-
run: |
|
68
|
-
apt-get update
|
69
|
-
apt-get install -y --no-install-recommends git
|
70
|
-
- name: Run all tests
|
71
|
-
run: |
|
72
|
-
gem install bundler
|
73
|
-
bundle install --jobs 4 --retry 3 --without tools docs benchmarks
|
74
|
-
bundle exec rspec
|