1 require "chef/mixin/shell_out"
9 extend Chef::Mixin::ShellOut
15 core_version_check["offers"].first["current"]
18 def current_plugin_version(name)
19 plugin_information(name)["version"]
24 def core_version_check
25 api_get("https://api.wordpress.org/core/version-check/1.7")
28 def plugin_information(name)
29 api_get("https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request[slug]=#{name}")
33 http_client = ::HTTPClient.new
34 http_client.ssl_config.set_trust_ca("/etc/ssl/certs/ca-certificates.crt")
35 @api_responses[url] ||= ::JSON.parse(http_client.get_content(url))