lib/codestatus.rb in codestatus-0.1.2 vs lib/codestatus.rb in codestatus-0.1.3
- old
+ new
@@ -2,16 +2,25 @@
require "codestatus/build_status"
require "codestatus/cli"
require "codestatus/package_resolvers/base"
require "codestatus/package_resolvers/rubygems_resolver"
require "codestatus/package_resolvers/npm_resolver"
+require "codestatus/package_resolvers/repository_not_found_error"
+require "codestatus/package_resolvers/package_not_found_error"
+require "codestatus/repositories/base"
require "codestatus/repositories/github_repository"
require "codestatus/repositories/bitbucket_repository"
module Codestatus
def self.status(repository: nil, registry: nil, package: nil)
if !repository && registry && package
- repository = resolver(registry).resolve(package: package)
+ begin
+ repository = resolver(registry).resolve!(package)
+ rescue PackageResolvers::PackageNotFoundError
+ abort "#{package}: Package not found"
+ rescue PackageResolvers::RepositoryNotFoundError
+ abort "#{package}: Repository not found"
+ end
end
if repository
repository.status
else