Adds passive WP version detection from stylesheets. Fix #478 - Ref #750

This commit is contained in:
erwanlr
2015-01-08 20:45:15 +01:00
parent 147a9e4968
commit 71fdef45c9
3 changed files with 42 additions and 0 deletions

View File

@@ -23,4 +23,11 @@ class WpVersion < WpItem
number == other.number
end
# @return [ Array<String> ] All the stable versions from version_file
def self.all(versions_file = WP_VERSIONS_FILE)
Nokogiri.XML(File.open(versions_file)).css('version').reduce([]) do |a, node|
a << node.text.to_s
end
end
end