opscode/chef — pull request #1708 by sczizzo (2014-07-29 20:50:05+00:00)
Title: Fix "cron" resource handling of special strings (e.g. @reboot, @yearly)

`cron` understands special strings like `@reboot` and `@yearly` in the `minute` attribute, like so:

```ruby
cron 'example' do
minute '@reboot'
hour ''
day ''
month ''
weekday ''
command 'example'
end
```

However, each time the resource is executed, a superfluous entry is added to the crontab, which looks something like this after three Chef runs:

```text
# Chef Name: example
@reboot example
@reboot example
@reboot example
```

Further, using the `:delete` action doesn't remove those entries.

This pull request fixes those issues by handling these special patterns specifically. The logic for `SPECIAL_PATTERN` follows the `CRON_PATTERN` exactly, so this is perhaps an "obvious" fix.