virtus 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -5
- data/Changelog.md +7 -1
- data/Gemfile +14 -5
- data/README.md +40 -19
- data/Rakefile +13 -3
- data/lib/virtus/configuration.rb +10 -5
- data/lib/virtus/version.rb +1 -1
- data/spec/integration/collection_member_coercion_spec.rb +34 -13
- data/spec/integration/hash_attributes_coercion_spec.rb +5 -5
- data/spec/shared/freeze_method_behavior.rb +5 -2
- data/spec/shared/idempotent_method_behaviour.rb +1 -1
- data/spec/shared/options_class_method.rb +3 -3
- data/spec/spec_helper.rb +3 -18
- data/spec/unit/virtus/attribute/boolean/coerce_spec.rb +3 -3
- data/spec/unit/virtus/attribute/boolean/value_coerced_predicate_spec.rb +3 -3
- data/spec/unit/virtus/attribute/class_methods/build_spec.rb +48 -24
- data/spec/unit/virtus/attribute/class_methods/coerce_spec.rb +2 -2
- data/spec/unit/virtus/attribute/coerce_spec.rb +9 -9
- data/spec/unit/virtus/attribute/coercible_predicate_spec.rb +2 -2
- data/spec/unit/virtus/attribute/collection/class_methods/build_spec.rb +2 -2
- data/spec/unit/virtus/attribute/collection/coerce_spec.rb +5 -5
- data/spec/unit/virtus/attribute/custom_collection_spec.rb +8 -2
- data/spec/unit/virtus/attribute/defined_spec.rb +2 -2
- data/spec/unit/virtus/attribute/embedded_value/class_methods/build_spec.rb +30 -15
- data/spec/unit/virtus/attribute/embedded_value/coerce_spec.rb +25 -11
- data/spec/unit/virtus/attribute/get_spec.rb +2 -2
- data/spec/unit/virtus/attribute/hash/class_methods/build_spec.rb +7 -7
- data/spec/unit/virtus/attribute/hash/coerce_spec.rb +9 -9
- data/spec/unit/virtus/attribute/lazy_predicate_spec.rb +2 -2
- data/spec/unit/virtus/attribute/rename_spec.rb +6 -3
- data/spec/unit/virtus/attribute/required_predicate_spec.rb +2 -2
- data/spec/unit/virtus/attribute/set_default_value_spec.rb +43 -10
- data/spec/unit/virtus/attribute/set_spec.rb +1 -1
- data/spec/unit/virtus/attribute/value_coerced_predicate_spec.rb +2 -2
- data/spec/unit/virtus/attribute_set/append_spec.rb +2 -2
- data/spec/unit/virtus/attribute_set/define_reader_method_spec.rb +12 -11
- data/spec/unit/virtus/attribute_set/define_writer_method_spec.rb +13 -12
- data/spec/unit/virtus/attribute_set/each_spec.rb +3 -3
- data/spec/unit/virtus/attribute_set/element_reference_spec.rb +1 -1
- data/spec/unit/virtus/attribute_set/element_set_spec.rb +2 -2
- data/spec/unit/virtus/attribute_set/merge_spec.rb +2 -2
- data/spec/unit/virtus/attribute_set/reset_spec.rb +17 -8
- data/spec/unit/virtus/attribute_spec.rb +4 -4
- data/spec/unit/virtus/element_reader_spec.rb +1 -1
- data/spec/unit/virtus/freeze_spec.rb +10 -3
- data/spec/unit/virtus/model_spec.rb +35 -4
- data/spec/unit/virtus/set_default_attributes_spec.rb +10 -3
- data/spec/unit/virtus/value_object_spec.rb +13 -3
- data/virtus.gemspec +6 -4
- metadata +16 -8
- data/Gemfile.devtools +0 -71
- data/config/flay.yml +0 -3
- data/config/flog.yml +0 -2
- data/config/mutant.yml +0 -15
- data/config/reek.yml +0 -146
- data/config/yardstick.yml +0 -2
@@ -12,7 +12,7 @@ describe Virtus::AttributeSet, '#merge' do
|
|
12
12
|
let(:attributes) { [] }
|
13
13
|
let(:attribute) { Virtus::Attribute.build(String, :name => name) }
|
14
14
|
|
15
|
-
it {
|
15
|
+
it { is_expected.to equal(object) }
|
16
16
|
|
17
17
|
it 'adds an attribute' do
|
18
18
|
expect { subject }.to change { object.to_a }.from(attributes).to([attribute])
|
@@ -23,7 +23,7 @@ describe Virtus::AttributeSet, '#merge' do
|
|
23
23
|
let(:attributes) { [Virtus::Attribute.build(String, :name => name)] }
|
24
24
|
let(:attribute) { Virtus::Attribute.build(String, :name => name) }
|
25
25
|
|
26
|
-
it {
|
26
|
+
it { is_expected.to equal(object) }
|
27
27
|
|
28
28
|
it 'replaces the original attribute' do
|
29
29
|
expect { subject }.to change { object.to_a }.from(attributes).to([attribute])
|
@@ -11,27 +11,36 @@ describe Virtus::AttributeSet, '#reset' do
|
|
11
11
|
context 'when the parent has no attributes' do
|
12
12
|
let(:parent) { described_class.new }
|
13
13
|
|
14
|
-
it {
|
14
|
+
it { is_expected.to equal(object) }
|
15
15
|
|
16
|
-
|
16
|
+
describe '#to_set' do
|
17
|
+
subject { super().to_set }
|
18
|
+
it { is_expected.to eq(Set[ attribute ]) }
|
19
|
+
end
|
17
20
|
end
|
18
21
|
|
19
22
|
context 'when the parent has attributes that are not duplicates' do
|
20
23
|
let(:parent_attribute) { Virtus::Attribute.build(String, :name => :parent_name) }
|
21
24
|
let(:parent) { described_class.new([ parent_attribute ]) }
|
22
25
|
|
23
|
-
it {
|
26
|
+
it { is_expected.to equal(object) }
|
24
27
|
|
25
|
-
|
28
|
+
describe '#to_set' do
|
29
|
+
subject { super().to_set }
|
30
|
+
it { is_expected.to eq(Set[ attribute, parent_attribute ]) }
|
31
|
+
end
|
26
32
|
end
|
27
33
|
|
28
34
|
context 'when the parent has attributes that are duplicates' do
|
29
35
|
let(:parent_attribute) { Virtus::Attribute.build(String, :name => name) }
|
30
36
|
let(:parent) { described_class.new([ parent_attribute ]) }
|
31
37
|
|
32
|
-
it {
|
38
|
+
it { is_expected.to equal(object) }
|
33
39
|
|
34
|
-
|
40
|
+
describe '#to_set' do
|
41
|
+
subject { super().to_set }
|
42
|
+
it { is_expected.to eq(Set[ attribute ]) }
|
43
|
+
end
|
35
44
|
end
|
36
45
|
|
37
46
|
context 'when the parent has changed' do
|
@@ -39,7 +48,7 @@ describe Virtus::AttributeSet, '#reset' do
|
|
39
48
|
let(:parent) { described_class.new([ parent_attribute ]) }
|
40
49
|
let(:new_attribute) { Virtus::Attribute.build(String, :name => :parent_name) }
|
41
50
|
|
42
|
-
it {
|
51
|
+
it { is_expected.to equal(object) }
|
43
52
|
|
44
53
|
it 'includes changes from the parent' do
|
45
54
|
expect(object.to_set).to eql(Set[attribute, parent_attribute])
|
@@ -53,7 +62,7 @@ describe Virtus::AttributeSet, '#reset' do
|
|
53
62
|
context 'when the parent is nil' do
|
54
63
|
let(:parent) { nil }
|
55
64
|
|
56
|
-
it {
|
65
|
+
it { is_expected.to equal(object) }
|
57
66
|
|
58
67
|
it 'includes changes from the parent' do
|
59
68
|
expect { subject }.to_not change { object.to_set }
|
@@ -23,8 +23,8 @@ describe Virtus, '#attribute' do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
shared_examples_for 'an object with string attribute' do
|
26
|
-
it {
|
27
|
-
it {
|
26
|
+
it { is_expected.to respond_to(:test) }
|
27
|
+
it { is_expected.to respond_to(:test=) }
|
28
28
|
|
29
29
|
it 'can write and read the attribute' do
|
30
30
|
subject.test = :foo
|
@@ -218,8 +218,8 @@ describe Virtus, '#attribute' do
|
|
218
218
|
}
|
219
219
|
}
|
220
220
|
|
221
|
-
it {
|
222
|
-
it {
|
221
|
+
it { is_expected.to respond_to(:test) }
|
222
|
+
it { is_expected.to respond_to(:test=) }
|
223
223
|
|
224
224
|
it 'writes and reads attributes' do
|
225
225
|
subject.test = :foo
|
@@ -15,10 +15,17 @@ describe Virtus, '#freeze' do
|
|
15
15
|
|
16
16
|
let(:object) { model.new }
|
17
17
|
|
18
|
-
it {
|
18
|
+
it { is_expected.to be_frozen }
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
describe '#name' do
|
21
|
+
subject { super().name }
|
22
|
+
it { is_expected.to eql('foo') }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '#age' do
|
26
|
+
subject { super().age }
|
27
|
+
it { is_expected.to be(30) }
|
28
|
+
end
|
22
29
|
|
23
30
|
it "does not change dynamic default values" do
|
24
31
|
original_value = object.rand
|
@@ -148,8 +148,8 @@ describe Virtus, '.model' do
|
|
148
148
|
model.send(:include, mod)
|
149
149
|
end
|
150
150
|
|
151
|
-
it {
|
152
|
-
it {
|
151
|
+
it { is_expected.not_to respond_to(:attributes) }
|
152
|
+
it { is_expected.not_to respond_to(:attributes=) }
|
153
153
|
end
|
154
154
|
|
155
155
|
context 'with an instance' do
|
@@ -159,8 +159,39 @@ describe Virtus, '.model' do
|
|
159
159
|
subject.extend(mod)
|
160
160
|
end
|
161
161
|
|
162
|
-
it {
|
163
|
-
it {
|
162
|
+
it { is_expected.not_to respond_to(:attributes) }
|
163
|
+
it { is_expected.not_to respond_to(:attributes=) }
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
context 'when :required is set' do
|
168
|
+
let(:mod) { Virtus.model(:required => false) }
|
169
|
+
let(:model) { Class.new }
|
170
|
+
|
171
|
+
context 'with a class' do
|
172
|
+
subject { model.new }
|
173
|
+
|
174
|
+
before do
|
175
|
+
model.send(:include, mod)
|
176
|
+
model.attribute :name, String
|
177
|
+
end
|
178
|
+
|
179
|
+
it 'has attributes with :required option inherited from module' do
|
180
|
+
expect(model.attribute_set[:name]).to_not be_required
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
context 'with an instance' do
|
185
|
+
subject { model.new }
|
186
|
+
|
187
|
+
before do
|
188
|
+
subject.extend(mod)
|
189
|
+
subject.attribute :name, String
|
190
|
+
end
|
191
|
+
|
192
|
+
it 'has attributes with strict set to true' do
|
193
|
+
expect(subject.send(:attribute_set)[:name]).not_to be_required
|
194
|
+
end
|
164
195
|
end
|
165
196
|
end
|
166
197
|
end
|
@@ -18,8 +18,15 @@ describe Virtus, '#set_default_attributes!' do
|
|
18
18
|
object.set_default_attributes!
|
19
19
|
end
|
20
20
|
|
21
|
-
it {
|
21
|
+
it { is_expected.to be(object) }
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
describe '#name' do
|
24
|
+
subject { super().name }
|
25
|
+
it { is_expected.to eql('foo') }
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#age' do
|
29
|
+
subject { super().age }
|
30
|
+
it { is_expected.to be(30) }
|
31
|
+
end
|
25
32
|
end
|
@@ -6,8 +6,15 @@ describe Virtus::ValueObject do
|
|
6
6
|
|
7
7
|
let(:attributes) { Hash[:id => 1, :name => 'Jane Doe'] }
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
describe '#id' do
|
10
|
+
subject { super().id }
|
11
|
+
it { is_expected.to be(1) }
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#name' do
|
15
|
+
subject { super().name }
|
16
|
+
it { is_expected.to eql('Jane Doe') }
|
17
|
+
end
|
11
18
|
|
12
19
|
it 'sets private writers' do
|
13
20
|
expect(subject.class.attribute_set[:id]).to_not be_public_writer
|
@@ -95,7 +102,10 @@ describe Virtus::ValueObject do
|
|
95
102
|
|
96
103
|
let(:attributes) { Hash[:id => 1, :name => 'Jane Doe', :email => 'jane@doe.com'] }
|
97
104
|
|
98
|
-
|
105
|
+
describe '#email' do
|
106
|
+
subject { super().email }
|
107
|
+
it { is_expected.to eql('jane@doe.com') }
|
108
|
+
end
|
99
109
|
|
100
110
|
it 'sets private writers for additional values' do
|
101
111
|
expect(subclass.attribute_set[:email]).to_not be_public_writer
|
data/virtus.gemspec
CHANGED
@@ -4,7 +4,7 @@ require File.expand_path('../lib/virtus/version', __FILE__)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "virtus"
|
7
|
-
gem.version = Virtus::VERSION
|
7
|
+
gem.version = Virtus::VERSION.dup
|
8
8
|
gem.authors = [ "Piotr Solnica" ]
|
9
9
|
gem.email = [ "piotr.solnica@gmail.com" ]
|
10
10
|
gem.description = "Attributes on Steroids for Plain Old Ruby Objects"
|
@@ -18,7 +18,9 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.extra_rdoc_files = %w[LICENSE README.md TODO.md]
|
19
19
|
|
20
20
|
gem.add_dependency('descendants_tracker', '~> 0.0', '>= 0.0.3')
|
21
|
-
gem.add_dependency('equalizer',
|
22
|
-
gem.add_dependency('coercible',
|
23
|
-
gem.add_dependency('axiom-types',
|
21
|
+
gem.add_dependency('equalizer', '~> 0.0', '>= 0.0.9')
|
22
|
+
gem.add_dependency('coercible', '~> 1.0')
|
23
|
+
gem.add_dependency('axiom-types', '~> 0.1')
|
24
|
+
|
25
|
+
gem.add_development_dependency 'rake'
|
24
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: virtus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: descendants_tracker
|
@@ -78,6 +78,20 @@ dependencies:
|
|
78
78
|
- - "~>"
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0.1'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rake
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
81
95
|
description: Attributes on Steroids for Plain Old Ruby Objects
|
82
96
|
email:
|
83
97
|
- piotr.solnica@gmail.com
|
@@ -98,17 +112,11 @@ files:
|
|
98
112
|
- CONTRIBUTING.md
|
99
113
|
- Changelog.md
|
100
114
|
- Gemfile
|
101
|
-
- Gemfile.devtools
|
102
115
|
- Guardfile
|
103
116
|
- LICENSE
|
104
117
|
- README.md
|
105
118
|
- Rakefile
|
106
119
|
- TODO.md
|
107
|
-
- config/flay.yml
|
108
|
-
- config/flog.yml
|
109
|
-
- config/mutant.yml
|
110
|
-
- config/reek.yml
|
111
|
-
- config/yardstick.yml
|
112
120
|
- lib/virtus.rb
|
113
121
|
- lib/virtus/attribute.rb
|
114
122
|
- lib/virtus/attribute/accessor.rb
|
data/Gemfile.devtools
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
group :development do
|
4
|
-
gem 'rake', '~> 10.3.2'
|
5
|
-
gem 'rspec', '~> 3.0.0'
|
6
|
-
gem 'rspec-its', '~> 1.0.1'
|
7
|
-
gem 'yard', '~> 0.8.7.4'
|
8
|
-
|
9
|
-
platform :rbx do
|
10
|
-
gem 'rubysl-singleton', '~> 2.0.0'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
group :yard do
|
15
|
-
gem 'kramdown', '~> 1.3.3'
|
16
|
-
end
|
17
|
-
|
18
|
-
group :guard do
|
19
|
-
gem 'guard', '~> 2.6.1'
|
20
|
-
gem 'guard-bundler', '~> 2.0.0'
|
21
|
-
gem 'guard-rspec', '~> 4.2.9'
|
22
|
-
gem 'guard-rubocop', '~> 1.1.0'
|
23
|
-
|
24
|
-
# file system change event handling
|
25
|
-
gem 'listen', '~> 2.7.7'
|
26
|
-
gem 'rb-fchange', '~> 0.0.6', require: false
|
27
|
-
gem 'rb-fsevent', '~> 0.9.4', require: false
|
28
|
-
gem 'rb-inotify', '~> 0.9.5', require: false
|
29
|
-
|
30
|
-
# notification handling
|
31
|
-
gem 'libnotify', '~> 0.8.3', require: false
|
32
|
-
gem 'rb-notifu', '~> 0.0.4', require: false
|
33
|
-
gem 'terminal-notifier-guard', '~> 1.5.3', require: false
|
34
|
-
end
|
35
|
-
|
36
|
-
group :metrics do
|
37
|
-
gem 'coveralls', '~> 0.7.0'
|
38
|
-
gem 'flay', '~> 2.5.0'
|
39
|
-
gem 'flog', '~> 4.2.1'
|
40
|
-
gem 'reek', '~> 1.3.7'
|
41
|
-
gem 'rubocop', '~> 0.23.0'
|
42
|
-
gem 'simplecov', '~> 0.7.1'
|
43
|
-
gem 'yardstick', '~> 0.9.9'
|
44
|
-
|
45
|
-
platforms :mri do
|
46
|
-
gem 'mutant', '~> 0.5.23'
|
47
|
-
gem 'mutant-rspec', '~> 0.5.21'
|
48
|
-
end
|
49
|
-
|
50
|
-
platforms :ruby_19, :ruby_20 do
|
51
|
-
gem 'yard-spellcheck', '~> 0.1.5'
|
52
|
-
end
|
53
|
-
|
54
|
-
platform :rbx do
|
55
|
-
gem 'json', '~> 1.8.1'
|
56
|
-
gem 'racc', '~> 1.4.11'
|
57
|
-
gem 'rubysl-logger', '~> 2.0.0'
|
58
|
-
gem 'rubysl-open-uri', '~> 2.0.0'
|
59
|
-
gem 'rubysl-prettyprint', '~> 2.0.3'
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
group :benchmarks do
|
64
|
-
gem 'rbench', '~> 0.2.3'
|
65
|
-
end
|
66
|
-
|
67
|
-
platform :jruby do
|
68
|
-
group :jruby do
|
69
|
-
gem 'jruby-openssl', '~> 0.9.4'
|
70
|
-
end
|
71
|
-
end
|
data/config/flay.yml
DELETED
data/config/flog.yml
DELETED
data/config/mutant.yml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: virtus
|
3
|
-
namespace:
|
4
|
-
- 'Virtus::Attribute'
|
5
|
-
- 'Virtus::AttributeSet'
|
6
|
-
- 'Virtus::Builder'
|
7
|
-
- 'Virtus::ClassInclusions'
|
8
|
-
- 'Virtus::ClassMethods'
|
9
|
-
- 'Virtus::Configuration'
|
10
|
-
- 'Virtus::ConstMissingExtensions'
|
11
|
-
- 'Virtus::Extensions'
|
12
|
-
- 'Virtus::InstanceMethods'
|
13
|
-
- 'Virtus::Model'
|
14
|
-
- 'Virtus::ModuleExtensions'
|
15
|
-
- 'Virtus::ValueObject'
|
data/config/reek.yml
DELETED
@@ -1,146 +0,0 @@
|
|
1
|
-
---
|
2
|
-
Attribute:
|
3
|
-
enabled: false
|
4
|
-
BooleanParameter:
|
5
|
-
enabled: true
|
6
|
-
exclude: []
|
7
|
-
ClassVariable:
|
8
|
-
enabled: true
|
9
|
-
exclude: []
|
10
|
-
ControlParameter:
|
11
|
-
enabled: true
|
12
|
-
exclude:
|
13
|
-
- 'Virtus::InstanceMethods::Constructor#initialize'
|
14
|
-
DataClump:
|
15
|
-
enabled: true
|
16
|
-
max_copies: 2
|
17
|
-
min_clump_size: 2
|
18
|
-
exclude:
|
19
|
-
- 'Virtus::AttributeSet'
|
20
|
-
DuplicateMethodCall:
|
21
|
-
enabled: false
|
22
|
-
FeatureEnvy:
|
23
|
-
enabled: true
|
24
|
-
exclude:
|
25
|
-
- 'Virtus::Attribute::Boolean#value_coerced?'
|
26
|
-
- 'Virtus::AttributeSet#get'
|
27
|
-
- 'Virtus::AttributeSet#set'
|
28
|
-
- 'Virtus::AttributeSet#skip_default?'
|
29
|
-
- 'Virtus::Builder#add_extended_hook'
|
30
|
-
- 'Virtus::Builder#add_included_hook'
|
31
|
-
- 'Virtus::InstanceMethods#assert_valid_name'
|
32
|
-
- 'Virtus::TypeLookup#determine_type_from_primitive'
|
33
|
-
IrresponsibleModule:
|
34
|
-
enabled: true
|
35
|
-
exclude: []
|
36
|
-
LongParameterList:
|
37
|
-
enabled: true
|
38
|
-
exclude:
|
39
|
-
- 'Virtus::AttributeSet#define_reader_method'
|
40
|
-
- 'Virtus::AttributeSet#define_writer_method'
|
41
|
-
- 'Virtus::Extensions::Methods#attribute'
|
42
|
-
- 'Virtus::ModuleExtensions#attribute'
|
43
|
-
- 'Virtus::ModuleExtensions#self.setup'
|
44
|
-
- 'Virtus::ValueObject::ClassMethods#attribute'
|
45
|
-
max_params: 2
|
46
|
-
LongYieldList:
|
47
|
-
enabled: true
|
48
|
-
exclude: []
|
49
|
-
max_params: 2
|
50
|
-
NestedIterators:
|
51
|
-
enabled: true
|
52
|
-
max_allowed_nesting: 1
|
53
|
-
ignore_iterators: []
|
54
|
-
exclude:
|
55
|
-
- 'Virtus::Builder#add_extended_hook'
|
56
|
-
- 'Virtus::Builder#add_included_hook'
|
57
|
-
- 'Virtus::ModuleBuilder#add_included_hook'
|
58
|
-
- 'Virtus::Equalizer#define_cmp_method'
|
59
|
-
- 'Virtus::Equalizer#define_hash_method'
|
60
|
-
- 'Virtus::Equalizer#define_inspect_method'
|
61
|
-
NilCheck:
|
62
|
-
enabled: true
|
63
|
-
exclude:
|
64
|
-
- 'Virtus::Attribute::EmbeddedValue::FromOpenStruct#call'
|
65
|
-
- 'Virtus::Attribute::EmbeddedValue::FromStruct#call'
|
66
|
-
- 'Virtus::Attribute::Strict#coerce'
|
67
|
-
- 'Virtus::Options#options'
|
68
|
-
- 'Virtus::TypeLookup#determine_type_from_primitive'
|
69
|
-
RepeatedConditional:
|
70
|
-
enabled: true
|
71
|
-
max_ifs: 1
|
72
|
-
exclude:
|
73
|
-
- 'Virtus::AttributeSet'
|
74
|
-
- 'Virtus::Builder'
|
75
|
-
TooManyInstanceVariables:
|
76
|
-
enabled: true
|
77
|
-
max_instance_variables: 3
|
78
|
-
exclude:
|
79
|
-
- 'Virtus::Attribute'
|
80
|
-
- 'Virtus::Attribute::Builder'
|
81
|
-
- 'Virtus::Configuration'
|
82
|
-
TooManyMethods:
|
83
|
-
enabled: true
|
84
|
-
max_methods: 6
|
85
|
-
exclude:
|
86
|
-
- 'Virtus::Equalizer'
|
87
|
-
- 'Virtus::Builder'
|
88
|
-
- 'Virtus::Attribute'
|
89
|
-
- 'Virtus::AttributeSet'
|
90
|
-
TooManyStatements:
|
91
|
-
enabled: true
|
92
|
-
max_statements: 4
|
93
|
-
exclude:
|
94
|
-
- 'Virtus#self.included'
|
95
|
-
- 'Virtus::Attribute::Builder#self.determine_type'
|
96
|
-
- 'Virtus::Attribute::Collection#self.infer'
|
97
|
-
- 'Virtus::Attribute::Hash#self.infer'
|
98
|
-
- 'Virtus::Builder#add_extended_hook'
|
99
|
-
- 'Virtus::Builder#add_included_hook'
|
100
|
-
- 'Virtus::ModuleBuilder#add_included_hook'
|
101
|
-
- 'Virtus::ClassInclusions#self.included'
|
102
|
-
- 'Virtus::ClassMethods#self.extended'
|
103
|
-
- 'Virtus::Extensions#self.extended'
|
104
|
-
- 'Virtus::ModuleExtensions#included'
|
105
|
-
- 'Virtus::TypeLookup#determine_type_from_primitive'
|
106
|
-
- 'Virtus::ValueObject#self.included'
|
107
|
-
UncommunicativeMethodName:
|
108
|
-
enabled: true
|
109
|
-
reject:
|
110
|
-
- !ruby/regexp /^[a-z]$/
|
111
|
-
- !ruby/regexp /[0-9]$/
|
112
|
-
- !ruby/regexp /[A-Z]/
|
113
|
-
UncommunicativeModuleName:
|
114
|
-
enabled: true
|
115
|
-
exclude: []
|
116
|
-
reject:
|
117
|
-
- !ruby/regexp /^.$/
|
118
|
-
- !ruby/regexp /[0-9]$/
|
119
|
-
accept: []
|
120
|
-
UncommunicativeParameterName:
|
121
|
-
enabled: true
|
122
|
-
exclude: []
|
123
|
-
reject:
|
124
|
-
- !ruby/regexp /^.$/
|
125
|
-
- !ruby/regexp /[0-9]$/
|
126
|
-
- !ruby/regexp /[A-Z]/
|
127
|
-
accept: ['_']
|
128
|
-
UncommunicativeVariableName:
|
129
|
-
enabled: true
|
130
|
-
exclude: []
|
131
|
-
reject:
|
132
|
-
- !ruby/regexp /^.$/
|
133
|
-
- !ruby/regexp /[0-9]$/
|
134
|
-
- !ruby/regexp /[A-Z]/
|
135
|
-
accept: []
|
136
|
-
UnusedParameters:
|
137
|
-
enabled: true
|
138
|
-
exclude: []
|
139
|
-
UtilityFunction:
|
140
|
-
enabled: true
|
141
|
-
max_helper_calls: 0
|
142
|
-
exclude:
|
143
|
-
- 'Virtus::Attribute::Boolean#value_coerced?'
|
144
|
-
- 'Virtus::AttributeSet#set_default'
|
145
|
-
- 'Virtus::AttributeSet#skip_default?'
|
146
|
-
- 'Virtus::Extensions::Methods#merge_options'
|