<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet-cron_core/spec/unit, branch main</title>
<subtitle>Puppet module for core cron functionality</subtitle>
<id>https://cgit.fluxo.info/puppet-cron_core/atom?h=main</id>
<link rel='self' href='https://cgit.fluxo.info/puppet-cron_core/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/'/>
<updated>2023-11-22T23:13:28+00:00</updated>
<entry>
<title>Convert ProcessOutput to String explicitly</title>
<updated>2023-11-22T23:13:28+00:00</updated>
<author>
<name>Josh Cooper</name>
<email>joshcooper@users.noreply.github.com</email>
</author>
<published>2023-11-22T18:54:32+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=be5ae9bc9e198a00f2a790992b663dda374006ba'/>
<id>urn:sha1:be5ae9bc9e198a00f2a790992b663dda374006ba</id>
<content type='text'>
The `filetype` provider executes `crontab` using Puppet's execution API, which
returns ProcessOutput objects that inherit from String. See puppetlabs/puppet@732d450

The provider later uses String#gsub to strip off the HEADER. In Ruby 2.7, the
gsub method returns a new instance of ProcessOutput:

    irb(main):002:0&gt; Puppet::Util::Execution::ProcessOutput.new("# HEADER\n0 4 * * * /etc/init.d/script.sh\n", 0).gsub(/# HEADER/, '').class
    =&gt; Puppet::Util::Execution::ProcessOutput

If you later serialize the crontab entries to YAML using `puppet resource`, then
puppet warns about serializing unknown data types:

    # puppet resource cron --to_yaml
    Warning: Cron[unmanaged:/etc/init.d/script.sh-1]['command'] contains a Puppet::Util::Execution::ProcessOutput value. It will be converted to the String '/etc/init.d/script.sh'

This wasn't an issue with Ruby 3.2, because String#gsub always returns a String:

    irb(main):002:0&gt; Puppet::Util::Execution::ProcessOutput.new("# HEADER\n0 4 * * * /etc/init.d/script.sh\n", 0).gsub(/# HEADER/, '').class
    =&gt; String

This commit explicitly converts the ProcessOutput to a String so the provider
behaves consistently on all Ruby versions.

Fixes #61
</content>
</entry>
<entry>
<title>(MODULES-11197) Update to pdk-templates 2.2.0</title>
<updated>2021-10-01T11:57:09+00:00</updated>
<author>
<name>Gabriel Nagy</name>
<email>gabriel.nagy@puppet.com</email>
</author>
<published>2021-10-01T11:57:09+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=dd42efd5323314047d2c44e02f2f7e3472954697'/>
<id>urn:sha1:dd42efd5323314047d2c44e02f2f7e3472954697</id>
<content type='text'>
Includes REFERENCE.md ToC fixes for MODULES-8183.
</content>
</entry>
<entry>
<title>(maint) Switch to rspec-mocks</title>
<updated>2021-03-11T12:37:19+00:00</updated>
<author>
<name>Gabriel Nagy</name>
<email>gabriel.nagy@puppet.com</email>
</author>
<published>2021-03-11T12:17:09+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=51ebf2d8d5c02c7cd314edd9e6507163a8073785'/>
<id>urn:sha1:51ebf2d8d5c02c7cd314edd9e6507163a8073785</id>
<content type='text'>
</content>
</entry>
<entry>
<title>(MODULES-7786) Allow leading zeroes for cron params</title>
<updated>2020-08-10T12:44:35+00:00</updated>
<author>
<name>Dorin Pleava</name>
<email>dorin.pleava@puppet.com</email>
</author>
<published>2020-08-06T12:14:37+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=29925fb28a09075ea4c4105674dca2415e1c7800'/>
<id>urn:sha1:29925fb28a09075ea4c4105674dca2415e1c7800</id>
<content type='text'>
When applying a cron manigest that contains leading zeroes in a periodic
attribute (hour, minute, month, monthday, weekday), puppet will strip
down the zeroes even if they are accepted by the system cron.

Now puppet will only convert to integer the periodic attributes when
validating them, but will not change the input from the manifest.
</content>
</entry>
<entry>
<title>(MODULES-8603) Ignore .keep_* files</title>
<updated>2020-05-06T12:00:21+00:00</updated>
<author>
<name>Ewoud Kohl van Wijngaarden</name>
<email>ewoud@kohlvanwijngaarden.nl</email>
</author>
<published>2018-12-08T12:42:23+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=196dea8289d126aaf9a011a15b348fde0d5159d5'/>
<id>urn:sha1:196dea8289d126aaf9a011a15b348fde0d5159d5</id>
<content type='text'>
On Gentoo there's always a .keep_&lt;package&gt;-&lt;slot&gt; (e.g.,
.keep_cronbase-0) file inside the cron directory to ensure it's not
removed with rmdir. Since usernames are very unlikely to start with
.keep_, we can safely filter out these hidden files.
</content>
</entry>
<entry>
<title>(MODULES-8306) Port over the crontab filetypes from Puppet</title>
<updated>2018-12-08T01:55:20+00:00</updated>
<author>
<name>Enis Inan</name>
<email>enis.inan@puppet.com</email>
</author>
<published>2018-12-02T00:35:32+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=e49408174d1e7662bd18f088accd8cc33d0e152c'/>
<id>urn:sha1:e49408174d1e7662bd18f088accd8cc33d0e152c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update tests to pass on puppet 4</title>
<updated>2018-11-28T20:05:41+00:00</updated>
<author>
<name>Josh Cooper</name>
<email>josh@puppet.com</email>
</author>
<published>2018-11-27T23:48:59+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=4c8252342eef4bd443110e61a83365805c433dc7'/>
<id>urn:sha1:4c8252342eef4bd443110e61a83365805c433dc7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>(MODULES-8301) Update the unit tests with the crontab filetype fix</title>
<updated>2018-11-27T09:02:52+00:00</updated>
<author>
<name>Enis Inan</name>
<email>enis.inan@puppet.com</email>
</author>
<published>2018-11-27T08:55:11+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=51eda1c39f43386ac3b21360c2cc582c31a5c3d3'/>
<id>urn:sha1:51eda1c39f43386ac3b21360c2cc582c31a5c3d3</id>
<content type='text'>
Commit 420049f2 in Puppet fixed the crontab filetype's #read method
to use Puppet::Util::Execution.execute instead of %x. This commit
updates the unit tests to account for this change.
</content>
</entry>
<entry>
<title>Fix Layout/CommentIndentation violation</title>
<updated>2018-08-08T16:17:33+00:00</updated>
<author>
<name>Jorie Tappa</name>
<email>jorie@jorietappa.com</email>
</author>
<published>2018-08-08T16:17:33+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=79180eb1a5ddffc404df965617dbfcc7d6691c42'/>
<id>urn:sha1:79180eb1a5ddffc404df965617dbfcc7d6691c42</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix Style/RegexpLiteral violations</title>
<updated>2018-08-01T21:13:33+00:00</updated>
<author>
<name>Jorie Tappa</name>
<email>jorie@jorietappa.com</email>
</author>
<published>2018-08-01T21:09:42+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=286f7aaa3a1387b689a6a00db705f15b46579ce6'/>
<id>urn:sha1:286f7aaa3a1387b689a6a00db705f15b46579ce6</id>
<content type='text'>
</content>
</entry>
</feed>
