<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet-cron_core/spec/fixtures/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-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>Initial cron import from puppet 7a4c5f07bdf61a7bc7aa32a50e99489a604eac52</title>
<updated>2018-07-31T21:07:37+00:00</updated>
<author>
<name>Jorie Tappa</name>
<email>jorie@jorietappa.com</email>
</author>
<published>2018-07-31T19:56:46+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=a2af7dd0b9713f279724d2c7e6f17bfd8ce2d95b'/>
<id>urn:sha1:a2af7dd0b9713f279724d2c7e6f17bfd8ce2d95b</id>
<content type='text'>
</content>
</entry>
</feed>
