Sha256: a281200348423064c9fa2c536c4aa01d240b2123581696474e61c22495ada0c0

Contents?: true

Size: 478 Bytes

Versions: 6

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

require 'travis/cli'

module Travis
  module CLI
    class Cancel < RepoCommand
      description 'cancels a job or build'

      def run(number = last_build.number)
        authenticate
        entity = job(number) || build(number)
        error "could not find job or build #{repository.slug}##{number}" unless entity
        entity.cancel

        say 'canceled', "#{entity.class.one} ##{entity.number} has been %s"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
travis-1.14.0 lib/travis/cli/cancel.rb
travis-1.13.3 lib/travis/cli/cancel.rb
travis-1.13.2 lib/travis/cli/cancel.rb
travis-1.13.1 lib/travis/cli/cancel.rb
travis-1.13.0 lib/travis/cli/cancel.rb
travis-1.12.0 lib/travis/cli/cancel.rb