Sha256: 84876b517984c93c77cdaed4840ee29d8344912e88bbc25048f3ae1fdce4a807

Contents?: true

Size: 853 Bytes

Versions: 1

Compression:

Stored size: 853 Bytes

Contents

require "codestatus/version"
require "codestatus/build_status"
require "codestatus/repository_resolver"
require "codestatus/repository_resolver/user_defined_resolver"
require "codestatus/repository_resolver/rubygems_resolver"
require "codestatus/package_repository"
require "codestatus/package_repository/github_repository"

module Codestatus
  def self.status(slug = ARGV.first)
    slug = 'rubygems/apartment' unless slug
    package_registry, package_name = slug.split('/')

    resolver = RepositoryResolver.new(registry: package_registry, package: package_name)

    package_repository = resolver.repository
    if package_repository
      status = package_repository.status
      success = (status == BuildStatus::SUCCESS)
    else
      status = 'Repository not found'
      success = 1
    end
    puts status
    exit success ? 0 : 1
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codestatus-0.1.0 lib/codestatus.rb