Sha256: a5eb61c1db2f70f3606dbad26bdcbfbcc7acb5ed3b3fce3794b5d684059ad075

Contents?: true

Size: 495 Bytes

Versions: 254

Compression:

Stored size: 495 Bytes

Contents

module Travis
  module Client
    class LintResult
      Warning = Struct.new(:key, :message)
      attr_accessor :warnings

      def initialize(payload)
        @warnings = []
        payload   = payload['lint'] if payload['lint']

        Array(payload['warnings']).each do |warning|
          @warnings << Warning.new(warning['key'], warning['message'])
        end
      end

      def warnings?
        warnings.any?
      end

      def ok?
        !warnings?
      end
    end
  end
end

Version data entries

254 entries across 254 versions & 3 rubygems

Version Path
travis-1.11.1 lib/travis/client/lint_result.rb
travis-1.11.0 lib/travis/client/lint_result.rb
travis-1.10.1.travis.1341.9 lib/travis/client/lint_result.rb
travis-1.10.1.travis.1321.9 lib/travis/client/lint_result.rb
travis-1.10.1.travis.1312.9 lib/travis/client/lint_result.rb
travis-1.10.1.travis.1311.9 lib/travis/client/lint_result.rb
travis-1.10.1.travis.1305.9 lib/travis/client/lint_result.rb
travis-1.10.0 lib/travis/client/lint_result.rb
travis-1.9.2.travis.1304.9 lib/travis/client/lint_result.rb
travis-1.9.2.travis.1303.9 lib/travis/client/lint_result.rb
travis-1.10.0.pre.rc4 lib/travis/client/lint_result.rb
travis-1.10.0.pre.rc3 lib/travis/client/lint_result.rb
travis-1.10.0.pre.rc2 lib/travis/client/lint_result.rb
travis-1.9.2.travis.1288.9 lib/travis/client/lint_result.rb
travis-1.9.2.travis.1285.9 lib/travis/client/lint_result.rb
travis-1.9.2.travis.1279.9 lib/travis/client/lint_result.rb
travis-1.10.0.pre.rc1 lib/travis/client/lint_result.rb
travis-1.9.2.travis.1254.9 lib/travis/client/lint_result.rb
travis-1.9.2.travis.1236.9 lib/travis/client/lint_result.rb
travis-1.9.2.travis.1224.9 lib/travis/client/lint_result.rb