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.8.11.travis.1010.9 lib/travis/client/lint_result.rb
travis-1.8.11.travis.1009.9 lib/travis/client/lint_result.rb
travis-1.8.11.travis.1008.9 lib/travis/client/lint_result.rb
travis-1.8.11.travis.1007.9 lib/travis/client/lint_result.rb
travis-1.8.11.travis.1004.9 lib/travis/client/lint_result.rb
travis-1.8.11.travis.1003.9 lib/travis/client/lint_result.rb
travis-1.8.11.travis.1002.9 lib/travis/client/lint_result.rb
travis-1.8.11.travis.1001.9 lib/travis/client/lint_result.rb
travis-1.8.11.travis.1000.9 lib/travis/client/lint_result.rb
travis-1.8.11.travis.998.9 lib/travis/client/lint_result.rb
travis-1.8.10.travis.997.9 lib/travis/client/lint_result.rb
travis-1.8.10 lib/travis/client/lint_result.rb
travis-1.8.10.travis.994.9 lib/travis/client/lint_result.rb
travis-1.8.10.travis.953.11 lib/travis/client/lint_result.rb
travis-akerl-1.8.9.1 lib/travis/client/lint_result.rb
travis-akerl-1.8.9 lib/travis/client/lint_result.rb
travis-1.8.10.travis.950.11 lib/travis/client/lint_result.rb
travis-1.8.10.travis.948.11 lib/travis/client/lint_result.rb
travis-1.8.10.travis.946.11 lib/travis/client/lint_result.rb
travis-1.8.10.travis.944.11 lib/travis/client/lint_result.rb