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.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +260 -241
  3. data/LICENSE +1 -1
  4. data/README.md +18 -77
  5. data/dry-initializer.gemspec +34 -19
  6. data/lib/dry/initializer/builders/attribute.rb +78 -69
  7. data/lib/dry/initializer/builders/initializer.rb +56 -58
  8. data/lib/dry/initializer/builders/reader.rb +55 -47
  9. data/lib/dry/initializer/builders/signature.rb +29 -23
  10. data/lib/dry/initializer/builders.rb +9 -5
  11. data/lib/dry/initializer/config.rb +162 -158
  12. data/lib/dry/initializer/definition.rb +58 -54
  13. data/lib/dry/initializer/dispatchers/build_nested_type.rb +54 -40
  14. data/lib/dry/initializer/dispatchers/check_type.rb +45 -39
  15. data/lib/dry/initializer/dispatchers/prepare_default.rb +32 -25
  16. data/lib/dry/initializer/dispatchers/prepare_ivar.rb +13 -6
  17. data/lib/dry/initializer/dispatchers/prepare_optional.rb +14 -7
  18. data/lib/dry/initializer/dispatchers/prepare_reader.rb +29 -22
  19. data/lib/dry/initializer/dispatchers/prepare_source.rb +12 -5
  20. data/lib/dry/initializer/dispatchers/prepare_target.rb +44 -37
  21. data/lib/dry/initializer/dispatchers/unwrap_type.rb +21 -10
  22. data/lib/dry/initializer/dispatchers/wrap_type.rb +25 -17
  23. data/lib/dry/initializer/dispatchers.rb +48 -43
  24. data/lib/dry/initializer/dsl.rb +42 -34
  25. data/lib/dry/initializer/mixin/local.rb +19 -13
  26. data/lib/dry/initializer/mixin/root.rb +12 -7
  27. data/lib/dry/initializer/mixin.rb +17 -12
  28. data/lib/dry/initializer/struct.rb +34 -29
  29. data/lib/dry/initializer/undefined.rb +7 -1
  30. data/lib/dry/initializer/version.rb +7 -0
  31. data/lib/dry/initializer.rb +2 -0
  32. data/lib/dry-initializer.rb +2 -0
  33. data/lib/tasks/benchmark.rake +2 -0
  34. data/lib/tasks/profile.rake +4 -0
  35. metadata +25 -125
  36. data/.codeclimate.yml +0 -12
  37. data/.github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md +0 -10
  38. data/.github/ISSUE_TEMPLATE/---bug-report.md +0 -34
  39. data/.github/ISSUE_TEMPLATE/---feature-request.md +0 -18
  40. data/.github/workflows/custom_ci.yml +0 -74
  41. data/.github/workflows/docsite.yml +0 -34
  42. data/.github/workflows/sync_configs.yml +0 -34
  43. data/.gitignore +0 -12
  44. data/.rspec +0 -4
  45. data/.rubocop.yml +0 -89
  46. data/CODE_OF_CONDUCT.md +0 -13
  47. data/CONTRIBUTING.md +0 -29
  48. data/Gemfile +0 -38
  49. data/Guardfile +0 -5
  50. data/LICENSE.txt +0 -21
  51. data/Rakefile +0 -8
  52. data/benchmarks/compare_several_defaults.rb +0 -82
  53. data/benchmarks/plain_options.rb +0 -63
  54. data/benchmarks/plain_params.rb +0 -84
  55. data/benchmarks/with_coercion.rb +0 -71
  56. data/benchmarks/with_defaults.rb +0 -66
  57. data/benchmarks/with_defaults_and_coercion.rb +0 -59
  58. data/docsite/source/attributes.html.md +0 -106
  59. data/docsite/source/container-version.html.md +0 -39
  60. data/docsite/source/index.html.md +0 -43
  61. data/docsite/source/inheritance.html.md +0 -43
  62. data/docsite/source/optionals-and-defaults.html.md +0 -130
  63. data/docsite/source/options-tolerance.html.md +0 -27
  64. data/docsite/source/params-and-options.html.md +0 -74
  65. data/docsite/source/rails-support.html.md +0 -101
  66. data/docsite/source/readers.html.md +0 -43
  67. data/docsite/source/skip-undefined.html.md +0 -59
  68. data/docsite/source/type-constraints.html.md +0 -160
  69. data/spec/attributes_spec.rb +0 -38
  70. data/spec/coercion_of_nil_spec.rb +0 -25
  71. data/spec/custom_dispatchers_spec.rb +0 -35
  72. data/spec/custom_initializer_spec.rb +0 -30
  73. data/spec/default_values_spec.rb +0 -83
  74. data/spec/definition_spec.rb +0 -111
  75. data/spec/invalid_default_spec.rb +0 -13
  76. data/spec/list_type_spec.rb +0 -32
  77. data/spec/missed_default_spec.rb +0 -14
  78. data/spec/nested_type_spec.rb +0 -48
  79. data/spec/optional_spec.rb +0 -71
  80. data/spec/options_tolerance_spec.rb +0 -11
  81. data/spec/public_attributes_utility_spec.rb +0 -22
  82. data/spec/reader_spec.rb +0 -87
  83. data/spec/repetitive_definitions_spec.rb +0 -69
  84. data/spec/several_assignments_spec.rb +0 -41
  85. data/spec/spec_helper.rb +0 -29
  86. data/spec/subclassing_spec.rb +0 -49
  87. data/spec/type_argument_spec.rb +0 -35
  88. data/spec/type_constraint_spec.rb +0 -78
  89. data/spec/value_coercion_via_dry_types_spec.rb +0 -29
@@ -1,43 +1,51 @@
1
- module Dry::Initializer
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
- # Returns a version of the module with custom settings
9
- # @option settings [Boolean] :undefined
10
- # If unassigned params and options should be treated different from nil
11
- # @return [Dry::Initializer]
12
- def [](undefined: true, **)
13
- null = (undefined == false) ? nil : UNDEFINED
14
- Module.new.tap do |mod|
15
- mod.extend DSL
16
- mod.include self
17
- mod.send(:instance_variable_set, :@null, null)
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
- # Returns mixin module to be included to target class by hand
22
- # @return [Module]
23
- # @yield proc defining params and options
24
- def define(procedure = nil, &block)
25
- config = Config.new(null: null)
26
- config.instance_exec(&(procedure || block))
27
- config.mixin.include Mixin::Root
28
- config.mixin
29
- end
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
- private
34
+ private
32
35
 
33
- def extended(klass)
34
- config = Config.new(klass, null: null)
35
- klass.send :instance_variable_set, :@dry_initializer, config
36
- klass.include Mixin::Root
37
- end
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
- def self.extended(mod)
40
- mod.instance_variable_set :@null, UNDEFINED
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
- module Dry::Initializer::Mixin
2
- # @private
3
- module Local
4
- attr_reader :klass
1
+ # frozen_string_literal: true
5
2
 
6
- def inspect
7
- "Dry::Initializer::Mixin::Local[#{klass}]"
8
- end
9
- alias to_s inspect
10
- alias to_str inspect
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
- private
16
+ private
13
17
 
14
- def included(klass)
15
- @klass = klass
16
- super
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
- module Dry::Initializer::Mixin
2
- # @private
3
- module Root
4
- private
1
+ # frozen_string_literal: true
5
2
 
6
- def initialize(*args)
7
- __dry_initializer_initialize__(*args)
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
- module Dry::Initializer
2
- # @private
3
- module Mixin
4
- extend DSL # @deprecated
5
- include Dry::Initializer # @deprecated
6
- def self.extended(klass) # @deprecated
7
- warn "[DEPRECATED] Use Dry::Initializer instead of its alias" \
8
- " Dry::Initializer::Mixin. The later will be removed in v2.1.0"
9
- super
10
- end
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
- require_relative "mixin/root"
13
- require_relative "mixin/local"
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
- class Dry::Initializer::Struct
5
- extend Dry::Initializer
5
+ module Dry
6
+ module Initializer
7
+ class Struct
8
+ extend ::Dry::Initializer
6
9
 
7
- class << self
8
- undef_method :param
10
+ class << self
11
+ undef_method :param
9
12
 
10
- def new(options)
11
- super(**Hash(options).each_with_object({}) { |(k, v), h| h[k.to_sym] = v })
12
- end
13
- alias call new
14
- end
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
- # Represents event data as a nested hash with deeply stringified keys
18
- # @return [Hash<String, ...>]
19
- #
20
- def to_h
21
- self
22
- .class
23
- .dry_initializer
24
- .attributes(self)
25
- .each_with_object({}) { |(k, v), h| h[k.to_s] = __hashify(v) }
26
- end
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
- private
31
+ private
29
32
 
30
- def __hashify(value)
31
- case value
32
- when Hash
33
- value.each_with_object({}) { |(k, v), obj| obj[k.to_s] = __hashify(v) }
34
- when Array then value.map { |v| __hashify(v) }
35
- when Dry::Initializer::Struct then value.to_h
36
- else value
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
@@ -1,2 +1,8 @@
1
- module Dry::Initializer::UNDEFINED
1
+ # frozen_string_literal: true
2
+
3
+ module Dry
4
+ module Initializer
5
+ module UNDEFINED
6
+ end
7
+ end
2
8
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dry
4
+ module Initializer
5
+ VERSION = "3.1.1"
6
+ end
7
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "set"
2
4
 
3
5
  # Namespace for gems in a dry-rb community
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "dry/initializer"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  namespace :benchmark do
2
4
  desc "Runs benchmarks for plain params"
3
5
  task :plain_params do
@@ -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.0.2
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: 2019-11-06 00:00:00.000000000 Z
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: '10'
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: '10'
27
+ version: '0'
42
28
  - !ruby/object:Gem::Dependency
43
- name: dry-types
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.49.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.49.0
70
- description:
71
- email: andrew.kozin@gmail.com
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
- - spec/attributes_spec.rb
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: '2.3'
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.0.6
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,12 +0,0 @@
1
- # this file is managed by dry-rb/devtools project
2
-
3
- version: "2"
4
-
5
- exclude_patterns:
6
- - "benchmarks/"
7
- - "examples/"
8
- - "spec/"
9
-
10
- plugins:
11
- rubocop:
12
- enabled: true
@@ -1,10 +0,0 @@
1
- ---
2
- name: "⚠️ Please don't ask for support via issues"
3
- about: See CONTRIBUTING.md for more information
4
- title: ''
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
-
@@ -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