HomePhorge

(#15464) Make Puppet.version settable via Puppet.version=
d7cb3c75aebbUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#15464) Make Puppet.version settable via Puppet.version=

Without this patch applied the version string of Puppet is dynamically
set from the git describe tag in the Rakefile using monkey patching.

This is problematic because this causes a constant to be re-defined
which issues a warning in Ruby.

This patch fixes the problem by implementing the Puppet.version= module
method. The Rakefile will now set the Puppet version by using `require
'puppet/version' and calling Puppet.version = %x{git describe ...}`

Using a module method also has the benefit of making it easier to
intercept and mock Puppet version specific behavior.

From this point forward, the method Puppet.version should but used to
obtain the version string instead of the constant Puppet::PUPPETVERSION.

Details

Provenance
Jeff McCune <jeff@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU07f0b0e7e884: (#15464) Make Puppet usable as a Gem from source
Branches
Unknown
Tags
Unknown

Event Timeline

Jeff McCune <jeff@puppetlabs.com> committed rPUd7cb3c75aebb: (#15464) Make Puppet.version settable via Puppet.version= (authored by Jeff McCune <jeff@puppetlabs.com>).Aug 18 2012, 12:45 AM