<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet-cron_core/spec/unit/provider, 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-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 RSpec/RepeatedExample violations</title>
<updated>2018-08-01T16:27:33+00:00</updated>
<author>
<name>Jorie Tappa</name>
<email>jorie@jorietappa.com</email>
</author>
<published>2018-08-01T16:27:33+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=96d65f6d51da6b4798c81a717fb1a0d68c4c90e1'/>
<id>urn:sha1:96d65f6d51da6b4798c81a717fb1a0d68c4c90e1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Disable Security/YAMLLoad</title>
<updated>2018-08-01T15:51:11+00:00</updated>
<author>
<name>Jorie Tappa</name>
<email>jorie@jorietappa.com</email>
</author>
<published>2018-08-01T15:51:11+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=2164cbe478d0d95568832c9de45a66b3ead21301'/>
<id>urn:sha1:2164cbe478d0d95568832c9de45a66b3ead21301</id>
<content type='text'>
</content>
</entry>
</feed>
