Sha256: c83365520d62ff7365535ee98c9593d57eda61524494b92fcf057204cfd3a117

Contents?: true

Size: 580 Bytes

Versions: 19

Compression:

Stored size: 580 Bytes

Contents

require 'travis/cli'

module Travis
  module CLI
    class Status < RepoCommand
      on '-x', '--[no-]exit-code',    'sets the exit code to 1 if the build failed'
      on '-q', '--[no-]quiet',        'does not print anything'
      on '-p', '--[no-]fail-pending', 'sets the status code to 1 if the build is pending'

      def run
        say color(last_build.state, last_build.color), "build ##{last_build.number} %s" unless quiet?
        exit 1 if exit_code?    and last_build.unsuccessful?
        exit 1 if fail_pending? and last_build.pending?
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
travis-1.5.2 lib/travis/cli/status.rb
travis-1.5.1 lib/travis/cli/status.rb
travis-1.5.0 lib/travis/cli/status.rb
travis-1.4.0 lib/travis/cli/status.rb
travis-1.3.1 lib/travis/cli/status.rb
travis-1.3.0 lib/travis/cli/status.rb
travis-1.2.8 lib/travis/cli/status.rb
travis-1.2.7 lib/travis/cli/status.rb
travis-1.2.6 lib/travis/cli/status.rb
travis-1.2.5 lib/travis/cli/status.rb
travis-1.2.4 lib/travis/cli/status.rb
travis-1.2.3 lib/travis/cli/status.rb
travis-1.2.2 lib/travis/cli/status.rb
travis-1.2.1 lib/travis/cli/status.rb
travis-1.2.0 lib/travis/cli/status.rb
travis-1.1.3 lib/travis/cli/status.rb
travis-1.1.2 lib/travis/cli/status.rb
travis-1.1.1 lib/travis/cli/status.rb
travis-1.1.0 lib/travis/cli/status.rb