<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/ruby-gems/chef.git/spec/unit/property/validation_spec.rb, branch https</title>
<subtitle>github.com: opscode/chef.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/'/>
<entry>
<title>Force requiring properties</title>
<updated>2020-04-17T23:23:51+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2020-04-17T19:51:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=49aa17ad9805b6949baaa37cfe66f8cf2b8083a8'/>
<id>49aa17ad9805b6949baaa37cfe66f8cf2b8083a8</id>
<content type='text'>
All required properties are now required for all actions by default
even if the action does not reference the property.

In order to only make the property required for a subset of the
actions, specify them as an array of symbols to the required
options on the property.

```
property :whatever, String, required: %i{start stop}

action :start do
end

action :stop do
end

action :enable do
end

action :disable do
end
```

That property will be required for start+stop but not for
enable+disable.

There's an unaddressed edge case here where if you reference the
property in an action which was not specified that it will also
fail validation.  That is correct behavior.  We should probably
dig into how to warn the user that they must either remove the
reference to the property from that action or else to add the
action to the list of required actions on the property.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All required properties are now required for all actions by default
even if the action does not reference the property.

In order to only make the property required for a subset of the
actions, specify them as an array of symbols to the required
options on the property.

```
property :whatever, String, required: %i{start stop}

action :start do
end

action :stop do
end

action :enable do
end

action :disable do
end
```

That property will be required for start+stop but not for
enable+disable.

There's an unaddressed edge case here where if you reference the
property in an action which was not specified that it will also
fail validation.  That is correct behavior.  We should probably
dig into how to warn the user that they must either remove the
reference to the property from that action or else to add the
action to the list of required actions on the property.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Style/SymbolProc</title>
<updated>2019-07-05T20:26:53+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2019-07-05T20:26:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=3b10f9ca503dcbce747241281b9151d3d010f9ef'/>
<id>3b10f9ca503dcbce747241281b9151d3d010f9ef</id>
<content type='text'>
enforce pretzels.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
enforce pretzels.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Style/SymbolArray</title>
<updated>2019-07-02T22:11:54+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2019-07-02T22:11:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=e71560df5cebbfb209089c6255e37e65f0e34d95'/>
<id>e71560df5cebbfb209089c6255e37e65f0e34d95</id>
<content type='text'>
start enforcing using %i{} instead of arrays of symbols

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
start enforcing using %i{} instead of arrays of symbols

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix Layout/EmptyLineAfterGuardClause</title>
<updated>2019-07-02T22:09:07+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2019-07-02T22:09:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=7a1a6c8ef26c787e4b6dd1602f3d158b37e81720'/>
<id>7a1a6c8ef26c787e4b6dd1602f3d158b37e81720</id>
<content type='text'>
i like this one, gives visual priority to returns or raises that are
buried in the middle of things.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
i like this one, gives visual priority to returns or raises that are
buried in the middle of things.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Setting nil to properties with implicit nil sets default value</title>
<updated>2018-03-23T02:49:10+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2018-03-23T02:48:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=7eb06ba4180c2acd0821fc127e8f4149c0f88bca'/>
<id>7eb06ba4180c2acd0821fc127e8f4149c0f88bca</id>
<content type='text'>
- This makes converting core resources to properties safer

- This makes it easier to apply wrapping properties to subresources

property :foo, String, default: "foo"

This is where the change lies, and writing a nil here will now actually
write a "foo" to the variable.

property :foo, [ String, nil ], default: "foo"

This is unchanged.  Writing nil writes nil.

property :foo, String

Technically this is changed, since it writes the default value, but
since nil.equal?(nil) in a very deep way no behavior changes.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- This makes converting core resources to properties safer

- This makes it easier to apply wrapping properties to subresources

property :foo, String, default: "foo"

This is where the change lies, and writing a nil here will now actually
write a "foo" to the variable.

property :foo, [ String, nil ], default: "foo"

This is unchanged.  Writing nil writes nil.

property :foo, String

Technically this is changed, since it writes the default value, but
since nil.equal?(nil) in a very deep way no behavior changes.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement RFC 101: Custom Validation Messages</title>
<updated>2018-02-12T17:36:27+00:00</updated>
<author>
<name>Thom May</name>
<email>thom@chef.io</email>
</author>
<published>2018-02-12T15:10:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=edba4de26a16e5445a803814c2703f10e6317d12'/>
<id>edba4de26a16e5445a803814c2703f10e6317d12</id>
<content type='text'>
Adds validation_message as a property option

Signed-off-by: Thom May &lt;thom@chef.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds validation_message as a property option

Signed-off-by: Thom May &lt;thom@chef.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Chef-13:  Nillable properties</title>
<updated>2017-03-16T05:58:08+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2017-03-16T05:58:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=0d6c4462a6c88584ee8a2c8cedc0865c39880154'/>
<id>0d6c4462a6c88584ee8a2c8cedc0865c39880154</id>
<content type='text'>
remove deprecations and now properties are nillable and passing a nil is
now always a set, not a get.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
remove deprecations and now properties are nillable and passing a nil is
now always a set, not a get.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>add nillable apt_repository and nillable properties</title>
<updated>2016-04-14T18:30:40+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2016-04-14T18:30:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=03503d7352ccad45107b055fc711e86c7c5d2918'/>
<id>03503d7352ccad45107b055fc711e86c7c5d2918</id>
<content type='text'>
in Chef-13 nillable will become 'true' by default and we'll have
to deprecate and remove all nillable properties, but for now
this lets us opt-in, which was can't currently do in Chef-12.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
in Chef-13 nillable will become 'true' by default and we'll have
to deprecate and remove all nillable properties, but for now
this lets us opt-in, which was can't currently do in Chef-12.
</pre>
</div>
</content>
</entry>
<entry>
<title>autofixing auto-inserted delimiters</title>
<updated>2016-02-09T16:17:32+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2016-02-09T16:17:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=37e02399a6e1dd281808a556f1420f8cf6e846fd'/>
<id>37e02399a6e1dd281808a556f1420f8cf6e846fd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>auto fixing some rubocops</title>
<updated>2016-02-09T15:53:56+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2016-02-09T15:53:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=f073747786abbe6ada55ed24b696a03e39c3c45d'/>
<id>f073747786abbe6ada55ed24b696a03e39c3c45d</id>
<content type='text'>
Style/NegatedWhile
Style/ParenthesesAroundCondition
Style/WhileUntilDo
Style/WordArray
Performance/ReverseEach
Style/ColonMethodCall
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Style/NegatedWhile
Style/ParenthesesAroundCondition
Style/WhileUntilDo
Style/WordArray
Performance/ReverseEach
Style/ColonMethodCall
</pre>
</div>
</content>
</entry>
</feed>
