lib/polisher/bodhi.rb in polisher-0.6.1 vs lib/polisher/bodhi.rb in polisher-0.7.1

- old
+ new

@@ -1,23 +1,21 @@ # Polisher Bodhi Operations # # Licensed under the MIT license -# Copyright (C) 2013 Red Hat, Inc. +# Copyright (C) 2013-2014 Red Hat, Inc. +# XXX issue w/ retreiving packages from pkgwat causing sporadic issues: +# https://github.com/fedora-infra/fedora-packages/issues/55 + +# fedora pkgwat provides a frontend to bodhi require 'pkgwat' module Polisher class Bodhi def self.versions_for(name, &bl) - # XXX issue w/ retreiving packages from pkgwat causing issues: - # https://github.com/fedora-infra/fedora-packages/issues/55 - - # fedora pkgwat provides a frontend to bodhi - updates = Pkgwat.get_updates("rubygem-#{name}", 'all', 'all') # TODO set timeout - updates.reject! { |u| - u['stable_version'] == 'None' && u['testing_version'] == "None" - } - versions = updates.collect { |u| u['stable_version'] } + versions = Pkgwat.get_updates("rubygem-#{name}", 'all', 'all'). + select { |update| update['stable_version'] != 'None' }. + collect { |update| update['stable_version'] } bl.call(:bodhi, name, versions) unless(bl.nil?) versions end end end