1 require "chef/mixin/command"
4 require "php_serialize"
8 extend Chef::Mixin::Command
15 core_version_check["offers"].first["current"]
18 def current_plugin_version(name)
19 if svn_cat("http://plugins.svn.wordpress.org/#{name}/trunk/readme.txt") =~ /Stable tag:\s*([^\s\r]*)[\s\r]*/
28 def core_version_check
29 api_get("http://api.wordpress.org/core/version-check/1.6")
33 @api_responses[url] ||= ::PHP.unserialize(::HTTPClient.new.get_content(url))
37 unless @svn_responses[url]
38 status, stdout, stderr = output_of_command("svn cat #{url}", {})
39 handle_command_failures(status, "STDOUT: #{stdout}\nSTDERR: #{stderr}", :output_on_failure => true)
41 @svn_responses[url] = stdout.force_encoding("UTF-8")