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