<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/ruby-gems/chef.git/spec/unit/provider/launchd_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>Remove useless test</title>
<updated>2020-05-14T03:12:12+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2020-05-14T02:44:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=cf139b4011d3ded5a1194a0d78fe80667eccdc6d'/>
<id>cf139b4011d3ded5a1194a0d78fe80667eccdc6d</id>
<content type='text'>
We broke this and they didn't fail, refactored the code and
fixed it and now they're failing.  We've got coverage of this
in the functional tests now

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We broke this and they didn't fail, refactored the code and
fixed it and now they're failing.  We've got coverage of this
in the functional tests now

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update method name in launchd provider unit tests.</title>
<updated>2020-05-07T01:14:53+00:00</updated>
<author>
<name>Pete Higgins</name>
<email>pete@peterhiggins.org</email>
</author>
<published>2020-05-07T01:14:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=011eb4b1826d1f0cda4bddac526f938cc0cb6cef'/>
<id>011eb4b1826d1f0cda4bddac526f938cc0cb6cef</id>
<content type='text'>
Signed-off-by: Pete Higgins &lt;pete@peterhiggins.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Pete Higgins &lt;pete@peterhiggins.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix 4 cops</title>
<updated>2019-07-05T20:41:00+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2019-07-05T20:41:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=174a2748b54a5dbd746005e2aead59221b80f2b9'/>
<id>174a2748b54a5dbd746005e2aead59221b80f2b9</id>
<content type='text'>
- Layout/MultilineMethodCallBraceLayout
- Layout/ClosingParenthesisIndentation
- Layout/IndentFirstArgument
  EnforcedStyle: consistent
- Layout/BlockEndNewline

the first of these autocorrected to horrible looking code which exposed
that we really needed the other three as well, which also cleaned up a
bunch of other terrible looking code.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Layout/MultilineMethodCallBraceLayout
- Layout/ClosingParenthesisIndentation
- Layout/IndentFirstArgument
  EnforcedStyle: consistent
- Layout/BlockEndNewline

the first of these autocorrected to horrible looking code which exposed
that we really needed the other three as well, which also cleaned up a
bunch of other terrible looking code.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>changes for rubocop engine upgrades.</title>
<updated>2019-01-15T21:07:58+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2019-01-15T21:07:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=990974ca5cd44df0c77bb6a12fc57a3c32b92e23'/>
<id>990974ca5cd44df0c77bb6a12fc57a3c32b92e23</id>
<content type='text'>
this is the result of changes to rules we already previously had
enabled.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this is the result of changes to rules we already previously had
enabled.

Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix Layout/DotPosition</title>
<updated>2018-07-02T17:29:13+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2018-07-02T17:29:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=878560a22f37aec0c2dfe681b3743e027155be88'/>
<id>878560a22f37aec0c2dfe681b3743e027155be88</id>
<content type='text'>
Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix Layout/IndentHeredoc</title>
<updated>2018-07-02T17:27:03+00:00</updated>
<author>
<name>Lamont Granquist</name>
<email>lamont@scriptkiddie.org</email>
</author>
<published>2018-07-02T17:27:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=dcac6762380d011f73cf53a50476d31dab0025ee'/>
<id>dcac6762380d011f73cf53a50476d31dab0025ee</id>
<content type='text'>
Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Lamont Granquist &lt;lamont@scriptkiddie.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Deprecate creating properties whose names are already methods</title>
<updated>2017-01-18T11:22:10+00:00</updated>
<author>
<name>Adam Leff</name>
<email>adam@leff.co</email>
</author>
<published>2016-12-02T19:51:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=5ece8327c9d67fa13ca00cce5749a960c643b247'/>
<id>5ece8327c9d67fa13ca00cce5749a960c643b247</id>
<content type='text'>
When creating a resource, a user can create a property that is the same
name as an already-existing Ruby method, such as `#hash`. In the case of
the `#hash` method, this can cause issues when attempting to adding
resources to other data structures, such as Arrays or Hashes. In other
examples, this could cause unexpected behavior that is incredibly
difficult to troubleshoot.

This change adds a deprecation warning in the case where a user adds
a property to a resource that the resource instance already responds to.
If y'all are OK with this approach, I'll be happy to write up the
deprecation doc for this for docs.chef.io.

Signed-off-by: Adam Leff &lt;adam@leff.co&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When creating a resource, a user can create a property that is the same
name as an already-existing Ruby method, such as `#hash`. In the case of
the `#hash` method, this can cause issues when attempting to adding
resources to other data structures, such as Arrays or Hashes. In other
examples, this could cause unexpected behavior that is incredibly
difficult to troubleshoot.

This change adds a deprecation warning in the case where a user adds
a property to a resource that the resource instance already responds to.
If y'all are OK with this approach, I'll be happy to write up the
deprecation doc for this for docs.chef.io.

Signed-off-by: Adam Leff &lt;adam@leff.co&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Respond to review comments and chefstyle</title>
<updated>2016-11-10T12:06:37+00:00</updated>
<author>
<name>Thom May</name>
<email>thom@chef.io</email>
</author>
<published>2016-10-06T13:56:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=65135ccabb85dd4c20982492f1f2cfeed6b12570'/>
<id>65135ccabb85dd4c20982492f1f2cfeed6b12570</id>
<content type='text'>
Signed-off-by: Thom May &lt;thom@chef.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thom May &lt;thom@chef.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Code style fixes; :lipstick:</title>
<updated>2016-11-10T12:02:11+00:00</updated>
<author>
<name>Andrew Burns</name>
<email>andrew@fetlife.com</email>
</author>
<published>2016-07-15T17:21:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=fd5d5238c95d3d5d9a25812f91295805a90026cf'/>
<id>fd5d5238c95d3d5d9a25812f91295805a90026cf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>launchd: start_calendar_interval validity checking</title>
<updated>2016-11-10T12:02:11+00:00</updated>
<author>
<name>Andrew Burns</name>
<email>andrew@fetlife.com</email>
</author>
<published>2016-07-14T15:15:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/ruby-gems/chef.git/commit/?id=29ff4157f6144cc73967414cea60d7f426f00b91'/>
<id>29ff4157f6144cc73967414cea60d7f426f00b91</id>
<content type='text'>
StartCalendarInterval has some gotchas so we coerce it to sanity check.

According to `man 5 launchd.plist`:
  StartCalendarInterval [is a] &lt;dictionary of integers or array of dictionaries of integers&gt;
    ... Missing arguments are considered to be wildcard.

What the man page doesn't state, but what was observed (OSX 10.11.5, launchctrl v3.4.0) is that key that are specified, _but with invalid values, will also be silently treated as a wildcard values.

This means that an entry like:
  { "Hour"=&gt;0, "Weekday"=&gt;"6-7"}
will not just run on midnight of Sat and Sun, rather it will run _every_ midnight.

We check to make sure that the values are integers and not strings, adhering to the manpage documentation.

This also ensures that only keys that StartCalendarInterval supports will be passed.
This eliminates passing a key (like `:hour` or `'hour') and thinking it works when in reality launchd is just treating it as a wildcard.

NOTE: This is a "breaking" change in that: it will break existing cookbooks that are using the current docs: https://docs.chef.io/resource_launchd.html (See start_calendar_interval); however the generated plist doesn't appear to actually do what was intended anyway.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
StartCalendarInterval has some gotchas so we coerce it to sanity check.

According to `man 5 launchd.plist`:
  StartCalendarInterval [is a] &lt;dictionary of integers or array of dictionaries of integers&gt;
    ... Missing arguments are considered to be wildcard.

What the man page doesn't state, but what was observed (OSX 10.11.5, launchctrl v3.4.0) is that key that are specified, _but with invalid values, will also be silently treated as a wildcard values.

This means that an entry like:
  { "Hour"=&gt;0, "Weekday"=&gt;"6-7"}
will not just run on midnight of Sat and Sun, rather it will run _every_ midnight.

We check to make sure that the values are integers and not strings, adhering to the manpage documentation.

This also ensures that only keys that StartCalendarInterval supports will be passed.
This eliminates passing a key (like `:hour` or `'hour') and thinking it works when in reality launchd is just treating it as a wildcard.

NOTE: This is a "breaking" change in that: it will break existing cookbooks that are using the current docs: https://docs.chef.io/resource_launchd.html (See start_calendar_interval); however the generated plist doesn't appear to actually do what was intended anyway.
</pre>
</div>
</content>
</entry>
</feed>
