Skip to content

Instantly share code, notes, and snippets.

@yfeldblum
Forked from patcon/chef-log.txt
Created April 11, 2012 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yfeldblum/2363520 to your computer and use it in GitHub Desktop.
Save yfeldblum/2363520 to your computer and use it in GitHub Desktop.
original_pear_version = nil
ruby_block "check_pear_version" do
block do
original_pear_version = %x[ pear -V 2>&1 ].match(/PEAR.*(\d+\.\d+\.\d+)/)[1]
original_pear_version = Gem::Version.create(original_pear_version)
end
end
declared_pear_version = Gem::Version.create("1.6.1")
php_pear "PEAR" do
version declared_pear_version.to_s
options "--force"
action :install
only_if { original_pear_version != declared_pear_version }
end
@patcon
Copy link

patcon commented Apr 12, 2012

Thanks @yfeldblum -- really appreciate that you took the time, even though I had to unceremoniously bail :)

Funny, I was thinking conciseness was important above all else, but sometimes I forget about legibility and self-documentation. If only just from the way you manage the librarian project, you've totally got my respect, and I take any advice to heart in informing my future ruby'ing!

@yfeldblum
Copy link
Author

yfeldblum commented Apr 12, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment