Method: ARPM::List.versions

Defined in:
lib/arpm/list.rb

.versions(package_name) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/arpm/list.rb', line 80

def self.versions(package_name)
  # Get all the packages
  packages = JSON.parse(File.read(path)) rescue []

  # Search for the specified package
  list_package = packages.select { |p| p.keys[0] == package_name }.first

  # Return an array of the versions
  list_package[package_name]

end