dry-initializer 0.11.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +8 -0
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.rubocop.yml +14 -62
- data/.travis.yml +15 -11
- data/CHANGELOG.md +538 -158
- data/Gemfile +2 -2
- data/LICENSE.txt +1 -1
- data/README.md +6 -6
- data/Rakefile +2 -41
- data/benchmarks/{several_defaults.rb → compare_several_defaults.rb} +4 -4
- data/benchmarks/{without_options.rb → plain_options.rb} +21 -10
- data/benchmarks/{params.rb → plain_params.rb} +20 -9
- data/benchmarks/{with_types.rb → with_coercion.rb} +23 -16
- data/benchmarks/with_defaults.rb +19 -8
- data/benchmarks/{with_types_and_defaults.rb → with_defaults_and_coercion.rb} +21 -12
- data/dry-initializer.gemspec +4 -4
- data/lib/dry/initializer/builders/attribute.rb +81 -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 +172 -0
- data/lib/dry/initializer/definition.rb +116 -0
- data/lib/dry/initializer/dispatchers.rb +44 -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 +8 -70
- data/lib/dry/initializer.rb +49 -12
- data/lib/tasks/benchmark.rake +41 -0
- data/lib/tasks/profile.rake +78 -0
- data/spec/attributes_spec.rb +38 -0
- data/spec/coercion_of_nil_spec.rb +25 -0
- data/spec/custom_dispatchers_spec.rb +35 -0
- data/spec/custom_initializer_spec.rb +1 -1
- data/spec/default_values_spec.rb +8 -8
- data/spec/definition_spec.rb +107 -0
- data/spec/invalid_default_spec.rb +2 -2
- data/spec/missed_default_spec.rb +3 -3
- data/spec/optional_spec.rb +35 -8
- 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 +41 -21
- data/spec/several_assignments_spec.rb +41 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/subclassing_spec.rb +7 -3
- data/spec/type_argument_spec.rb +1 -1
- data/spec/type_constraint_spec.rb +38 -7
- data/spec/value_coercion_via_dry_types_spec.rb +12 -4
- metadata +37 -40
- data/benchmarks/options.rb +0 -54
- data/benchmarks/params_vs_options.rb +0 -35
- data/lib/dry/initializer/builder.rb +0 -100
- data/lib/dry/initializer/errors/default_value_error.rb +0 -6
- data/lib/dry/initializer/errors/order_error.rb +0 -7
- data/lib/dry/initializer/errors/plugin_error.rb +0 -6
- data/lib/dry/initializer/errors/redefinition_error.rb +0 -5
- data/lib/dry/initializer/errors/type_constraint_error.rb +0 -5
- data/lib/dry/initializer/errors.rb +0 -10
- data/lib/dry/initializer/plugins/base.rb +0 -47
- data/lib/dry/initializer/plugins/default_proc.rb +0 -28
- data/lib/dry/initializer/plugins/signature.rb +0 -28
- data/lib/dry/initializer/plugins/type_constraint.rb +0 -21
- data/lib/dry/initializer/plugins/variable_setter.rb +0 -30
- data/lib/dry/initializer/plugins.rb +0 -10
- data/lib/dry/initializer/signature.rb +0 -61
- data/spec/base_spec.rb +0 -21
- data/spec/container_spec.rb +0 -45
- data/spec/default_nil_spec.rb +0 -17
- data/spec/plugin_registry_spec.rb +0 -45
- data/spec/renaming_options_spec.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 861264b64b414e7ff11f68071a530e3208093092
|
4
|
+
data.tar.gz: f3426ffd2670dbe47c276d67fd972e86fdeb9677
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3205f5f09066d20a3f05255a71ae8451ec6c00b0c6701bdf2fb4d8a854a61d49d5b1eea952d4cd08d05e3165e8748d73dd1e530a39a12d85bb90e5514bf6c37c
|
7
|
+
data.tar.gz: 05205f55be677d470f553ec0e9fcf8d357ffc3ba245c9195b144c24cac478dd3aa2e1e8d6bcbbd6fc1b6b04d92d8e3e8345762bc76838651dab26d90632a31d2
|
data/.codeclimate.yml
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
engines:
|
3
3
|
rubocop:
|
4
4
|
enabled: true
|
5
|
+
checks:
|
6
|
+
Rubocop/Style/FrozenStringLiteralComment:
|
7
|
+
enabled: false
|
8
|
+
Rubocop/Style/PercentLiteralDelimiters:
|
9
|
+
enabled: false
|
10
|
+
Rubocop/Lint/UnderscorePrefixedVariableName:
|
11
|
+
enabled: false
|
5
12
|
duplication:
|
6
13
|
enabled: true
|
7
14
|
config:
|
@@ -10,6 +17,7 @@ engines:
|
|
10
17
|
exclude_paths:
|
11
18
|
- "benchmarks/**/*"
|
12
19
|
- "spec/**/*"
|
20
|
+
- "lib/tasks/**/*"
|
13
21
|
ratings:
|
14
22
|
paths:
|
15
23
|
- "lib/**/*"
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
@@ -3,38 +3,19 @@ AllCops:
|
|
3
3
|
DisplayCopNames: true
|
4
4
|
DisplayStyleGuide: true
|
5
5
|
StyleGuideCopsOnly: true
|
6
|
-
TargetRubyVersion: 2.
|
7
|
-
|
8
|
-
Lint/HandleExceptions:
|
9
|
-
Exclude:
|
10
|
-
- spec/**/*_spec.rb
|
11
|
-
|
12
|
-
Lint/RescueException:
|
13
|
-
Exclude:
|
14
|
-
- spec/**/*_spec.rb
|
15
|
-
|
16
|
-
Metrics/LineLength:
|
17
|
-
Max: 80
|
18
|
-
Exclude:
|
19
|
-
- spec/**/*_spec.rb
|
20
|
-
|
21
|
-
Style/AccessorMethodName:
|
6
|
+
TargetRubyVersion: 2.3
|
22
7
|
Exclude:
|
23
|
-
-
|
24
|
-
|
25
|
-
Style/Alias:
|
26
|
-
EnforcedStyle: prefer_alias_method
|
8
|
+
- lib/tasks/*.rake
|
27
9
|
|
28
|
-
|
10
|
+
Bundler/DuplicatedGem:
|
29
11
|
Enabled: false
|
30
12
|
|
31
|
-
Style/BlockDelimiters:
|
32
|
-
Exclude:
|
33
|
-
- spec/**/*_spec.rb
|
34
|
-
|
35
13
|
Style/CaseEquality:
|
36
14
|
Enabled: false
|
37
15
|
|
16
|
+
Style/ClassVars:
|
17
|
+
Enabled: false
|
18
|
+
|
38
19
|
Style/ClassAndModuleChildren:
|
39
20
|
Enabled: false
|
40
21
|
|
@@ -44,56 +25,27 @@ Style/Documentation:
|
|
44
25
|
Style/DoubleNegation:
|
45
26
|
Enabled: false
|
46
27
|
|
47
|
-
Style/EmptyLinesAroundClassBody:
|
48
|
-
Enabled: false
|
49
|
-
|
50
|
-
Style/EmptyLinesAroundModuleBody:
|
51
|
-
Enabled: false
|
52
|
-
|
53
|
-
Style/EmptyLineBetweenDefs:
|
54
|
-
Enabled: false
|
55
|
-
|
56
28
|
Style/FileName:
|
57
|
-
Enabled: false
|
58
|
-
|
59
|
-
Style/Lambda:
|
60
29
|
Exclude:
|
61
|
-
-
|
62
|
-
|
63
|
-
Style/ModuleFunction:
|
64
|
-
Enabled: false
|
65
|
-
|
66
|
-
Style/RaiseArgs:
|
67
|
-
EnforcedStyle: compact
|
30
|
+
- lib/dry-initializer.rb
|
68
31
|
|
69
|
-
Style/
|
32
|
+
Style/Lambda:
|
70
33
|
Exclude:
|
71
|
-
- spec
|
34
|
+
- spec/**/*.rb
|
72
35
|
|
73
|
-
Style/
|
74
|
-
EnforcedStyle: semantic
|
75
|
-
|
76
|
-
Style/SingleLineBlockParams:
|
36
|
+
Style/LambdaCall:
|
77
37
|
Enabled: false
|
78
38
|
|
79
|
-
Style/
|
39
|
+
Style/RescueModified:
|
80
40
|
Exclude:
|
81
|
-
- spec
|
82
|
-
|
83
|
-
Style/SpaceBeforeFirstArg:
|
84
|
-
Enabled: false
|
41
|
+
- spec/**/*.rb
|
85
42
|
|
86
|
-
Style/
|
43
|
+
Style/Semicolon:
|
87
44
|
Exclude:
|
88
|
-
-
|
89
|
-
- dry-initializer.gemspec
|
45
|
+
- spec/**/*.rb
|
90
46
|
|
91
47
|
Style/StringLiterals:
|
92
48
|
EnforcedStyle: double_quotes
|
93
49
|
|
94
50
|
Style/StringLiteralsInInterpolation:
|
95
51
|
EnforcedStyle: double_quotes
|
96
|
-
|
97
|
-
Style/TrivialAccessors:
|
98
|
-
Exclude:
|
99
|
-
- spec/**/*_spec.rb
|
data/.travis.yml
CHANGED
@@ -1,20 +1,24 @@
|
|
1
1
|
---
|
2
|
-
sudo: false
|
3
2
|
language: ruby
|
4
|
-
|
3
|
+
sudo: false
|
4
|
+
cache: bundler
|
5
|
+
bundler_args: --without benchmarks tools
|
5
6
|
script:
|
6
|
-
- bundle exec
|
7
|
-
- bundle exec rubocop
|
7
|
+
- bundle exec rake spec
|
8
8
|
rvm:
|
9
|
-
-
|
10
|
-
-
|
11
|
-
-
|
12
|
-
|
9
|
+
- 2.3.0
|
10
|
+
- 2.4.0
|
11
|
+
- jruby-9000
|
12
|
+
- rbx-3
|
13
13
|
- ruby-head
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
env:
|
15
|
+
global:
|
16
|
+
- JRUBY_OPTS='--dev -J-Xmx1024M'
|
17
17
|
matrix:
|
18
18
|
allow_failures:
|
19
|
+
- rvm: rbx-3
|
19
20
|
- rvm: ruby-head
|
20
21
|
- rvm: jruby-head
|
22
|
+
include:
|
23
|
+
- rvm: jruby-head
|
24
|
+
before_install: gem install bundler --no-ri --no-rdoc
|