dry-initializer 1.4.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -8
- data/.travis.yml +0 -3
- data/CHANGELOG.md +339 -196
- data/LICENSE.txt +1 -1
- data/README.md +3 -3
- data/Rakefile +2 -47
- data/benchmarks/{several_defaults.rb → compare_several_defaults.rb} +4 -4
- data/benchmarks/{without_options.rb → plain_options.rb} +20 -9
- data/benchmarks/{params.rb → plain_params.rb} +20 -9
- data/benchmarks/{with_types.rb → with_coercion.rb} +20 -9
- data/benchmarks/with_defaults.rb +19 -8
- data/benchmarks/{with_types_and_defaults.rb → with_defaults_and_coercion.rb} +21 -10
- data/dry-initializer.gemspec +3 -3
- data/lib/dry/initializer/builders/attribute.rb +76 -0
- data/lib/dry/initializer/builders/initializer.rb +61 -0
- data/lib/dry/initializer/builders/reader.rb +50 -0
- data/lib/dry/initializer/builders/signature.rb +32 -0
- data/lib/dry/initializer/builders.rb +7 -0
- data/lib/dry/initializer/config.rb +161 -0
- data/lib/dry/initializer/definition.rb +93 -0
- data/lib/dry/initializer/dsl.rb +43 -0
- data/lib/dry/initializer/mixin/local.rb +19 -0
- data/lib/dry/initializer/mixin/root.rb +10 -0
- data/lib/dry/initializer/mixin.rb +15 -0
- data/lib/dry/initializer.rb +45 -41
- data/lib/tasks/benchmark.rake +41 -0
- data/lib/tasks/profile.rake +78 -0
- data/spec/{options_var_spec.rb → attributes_spec.rb} +9 -9
- data/spec/custom_initializer_spec.rb +1 -1
- data/spec/default_values_spec.rb +6 -6
- data/spec/definition_spec.rb +21 -14
- data/spec/invalid_default_spec.rb +2 -2
- data/spec/missed_default_spec.rb +2 -2
- data/spec/optional_spec.rb +2 -2
- data/spec/options_tolerance_spec.rb +1 -1
- data/spec/public_attributes_utility_spec.rb +22 -0
- data/spec/reader_spec.rb +11 -11
- data/spec/repetitive_definitions_spec.rb +5 -5
- data/spec/several_assignments_spec.rb +1 -1
- data/spec/spec_helper.rb +5 -0
- data/spec/subclassing_spec.rb +7 -3
- data/spec/type_argument_spec.rb +1 -1
- data/spec/type_constraint_spec.rb +2 -2
- data/spec/value_coercion_via_dry_types_spec.rb +1 -1
- metadata +27 -27
- data/benchmarks/options.rb +0 -54
- data/benchmarks/params_vs_options.rb +0 -35
- data/benchmarks/profiler.rb +0 -28
- data/lib/dry/initializer/attribute.rb +0 -123
- data/lib/dry/initializer/builder.rb +0 -127
- data/lib/dry/initializer/class_dsl.rb +0 -37
- data/lib/dry/initializer/exceptions/default_value_error.rb +0 -8
- data/lib/dry/initializer/exceptions/params_order_error.rb +0 -8
- data/lib/dry/initializer/exceptions/type_constraint_error.rb +0 -7
- data/lib/dry/initializer/instance_dsl.rb +0 -15
- data/lib/dry/initializer/option.rb +0 -61
- data/lib/dry/initializer/param.rb +0 -52
- data/spec/gem_enhancement_spec.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d7b2eac100f891f9a301c572c97182eaf78db71
|
4
|
+
data.tar.gz: da3d4896fcd9037b02c334f0c9fabec64dc79333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff805cc5d6808fbba1471b790049388c23f2c555dd7024c145e87e4e550a60310ceb8fe46858d235fc3bc55705c8df97c50ad465e80907c78e318834ce69321d
|
7
|
+
data.tar.gz: ef61fe2db0a4d404c39a4b0eb00c779c31dbddb0c4a926be77b7c9f7008c7e6e97c3d877df2161ecaf08ff4bd586ea913a9b3aeb2440d081b5c6cb130bdda66f
|
data/.rubocop.yml
CHANGED
@@ -3,7 +3,9 @@ AllCops:
|
|
3
3
|
DisplayCopNames: true
|
4
4
|
DisplayStyleGuide: true
|
5
5
|
StyleGuideCopsOnly: true
|
6
|
-
TargetRubyVersion: 2.
|
6
|
+
TargetRubyVersion: 2.3
|
7
|
+
Exclude:
|
8
|
+
- lib/tasks/*.rake
|
7
9
|
|
8
10
|
Bundler/DuplicatedGem:
|
9
11
|
Enabled: false
|
@@ -29,20 +31,18 @@ Style/FileName:
|
|
29
31
|
|
30
32
|
Style/Lambda:
|
31
33
|
Exclude:
|
32
|
-
- spec
|
34
|
+
- spec/**/*.rb
|
33
35
|
|
34
36
|
Style/LambdaCall:
|
35
37
|
Enabled: false
|
36
38
|
|
37
|
-
Style/
|
38
|
-
|
39
|
+
Style/RescueModified:
|
40
|
+
Exclude:
|
41
|
+
- spec/**/*.rb
|
39
42
|
|
40
43
|
Style/Semicolon:
|
41
44
|
Exclude:
|
42
|
-
- spec
|
43
|
-
|
44
|
-
Style/SignalException:
|
45
|
-
EnforcedStyle: semantic
|
45
|
+
- spec/**/*.rb
|
46
46
|
|
47
47
|
Style/StringLiterals:
|
48
48
|
EnforcedStyle: double_quotes
|
data/.travis.yml
CHANGED
@@ -6,11 +6,9 @@ bundler_args: --without benchmarks tools
|
|
6
6
|
script:
|
7
7
|
- bundle exec rake spec
|
8
8
|
rvm:
|
9
|
-
- 2.2
|
10
9
|
- 2.3.0
|
11
10
|
- 2.4.0
|
12
11
|
- jruby-9000
|
13
|
-
- rbx-2
|
14
12
|
- rbx-3
|
15
13
|
- ruby-head
|
16
14
|
env:
|
@@ -18,7 +16,6 @@ env:
|
|
18
16
|
- JRUBY_OPTS='--dev -J-Xmx1024M'
|
19
17
|
matrix:
|
20
18
|
allow_failures:
|
21
|
-
- rvm: rbx-2
|
22
19
|
- rvm: rbx-3
|
23
20
|
- rvm: ruby-head
|
24
21
|
- rvm: jruby-head
|