Method: MotherBrain::PluginManager#latest
- Defined in:
- lib/mb/plugin_manager.rb
#latest(name, options = {}) ⇒ MB::Plugin?
Return most current version of the plugin of the given name
256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/mb/plugin_manager.rb', line 256 def latest(name, = {}) = .reverse_merge(remote: false) potentials = list(name: name, remote: false).map(&:version) potentials += remote_cookbook_versions(name) if [:remote] potentials = potentials.collect { |version| Semverse::Version.new(version) }.uniq.sort.reverse potentials.find do |version| found = find(name, version.to_s, .slice(:remote)) return found if found end nil end |