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