opscode-cookbooks/perl — pull request #11 by faizk (2013-09-27 05:34:00+00:00)
Title: COOK-3666: add an  `upgrade` param to `cpan_module`

`cpan_module` currently doesn't provide a way to ensure that
the given Perl module installed on the system is the latest available.
The `package` resource has an `:upgrade` action:
`cpan_module` would benefit from having one as well.

Usually, `cpanm` will automatically upgrade the module if already installed .
While `cpan_module` calls `cpanm`, it uses an idempotency check
via `perl -m#{module_name}` and if a (possibly outdated) version of the package
happens to be already on the system (perhaps because it was provided by
a an RPM/DEB version), it will never have a chance to be updated.

This commit causes the idempotency check to be handled directly by `cpanm`
when `upgrade true` is passed.