lib/aptly_repo.rb in aptly_cli-0.6.0 vs lib/aptly_repo.rb in aptly_cli-0.6.1
- old
+ new
@@ -46,10 +46,12 @@
:headers => { 'Content-Type' => 'application/json' })
end
def repo_list
uri = '/repos'
- get(uri)
+ JSON.parse get(uri).body
+ rescue JSON::ParserError
+ raise "Invalid response from '#{self.class.base_uri}#{uri}'"
end
def repo_package_add(repo_options, packages)
raise ArgumentError, 'Repository name is required' if repo_options[:name].nil? || repo_options[:name].empty?