chef

https://github.com/opscode/chef

Ruby

A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.

Chef::Provider::Package#target_version_already_installed?

Check the current_version against either the candidate_version or the new_version

For some reason the windows provider subclasses this (to implement passing Arrays to
versions for some reason other than multipackage stuff, which is mildly terrifying).

This MUST have 'equality' semantics -- the exact thing matches the exact thing.

The current_version should probably be dropped out of the method signature, it should
always be the first argument.

The name is not just bad, but i find it completely misleading, consider:

   target_version_already_installed?(current_version, new_version)
   target_version_already_installed?(current_version, candidate_version)

which of those is the 'target_version'?  i'd say the new_version and i'm confused when
i see it called with the candidate_version.

`current_version_equals?(version)` would be a better name

Source | Google | Stack overflow

Edit

git clone [email protected]:opscode/chef.git

cd chef

open lib/chef/provider/package.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Chef--Provider--Package-target_version_already_installed--for-pr


# Commit to git

git add lib/chef/provider/package.rbgit commit -m "better docs for Chef::Provider::Package#target_version_already_installed?"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Chef--Provider--Package-target_version_already_installed--for-pr

hub pull-request


# Celebrate!