Sha256: a98f96d9a79be4ff93dab4b0c427c6500622d9c0d63aff975d44f66d3632e198

Contents?: true

Size: 788 Bytes

Versions: 15

Compression:

Stored size: 788 Bytes

Contents

require 'travis/cli'
require 'travis/tools/safe_string'
require 'travis/tools/system'

module Travis
  module CLI
    class Logs < RepoCommand
      description "streams test logs"

      def setup
        super
        check_websocket
      end

      include Tools::SafeString
      def run(number = last_build.number)
        error "##{number} is not a job, try #{number}.1" unless job = job(number)
        job.log.body { |part| print interactive? ? encoded(part) : clean(part) }
      end

      private

        def check_websocket
          require 'websocket-native'
        rescue LoadError => e
          raise e if e.respond_to?(:path) and e.path != 'websocket-native'
          info "speed up log streaming by installing the websocket-native gem"
        end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
travis-1.5.6.travis.317.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.315.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.314.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.312.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.307.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.306.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.304.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.303.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.301.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.299.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.297.4 lib/travis/cli/logs.rb
travis-1.5.6.travis.296.4 lib/travis/cli/logs.rb
travis-1.5.5 lib/travis/cli/logs.rb
travis-1.5.4 lib/travis/cli/logs.rb
travis-1.5.3 lib/travis/cli/logs.rb