Method: Chef::Provider::Package::Macports#current_installed_version

Defined in:
lib/chef/provider/package/macports.rb

#current_installed_versionObject



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/chef/provider/package/macports.rb', line 34

def current_installed_version
  command = [ "port", "installed", new_resource.package_name ]
  output = get_response_from_command(command)

  response = nil
  output.each_line do |line|
    match = line.match(/^.+ @([^\s]+) \(active\)$/)
    response = match[1] if match
  end
  response
end