Sha256: 069b224e42b87238db7a8de8d9c2d9240f84513b8644054a6fef6ccc365c2e74

Contents?: true

Size: 513 Bytes

Versions: 4

Compression:

Stored size: 513 Bytes

Contents

require 'travis/client'

module Travis
  module Client
    class Artifact < Entity
      # @!parse attr_reader :job_id, :type, :body
      attributes :job_id, :type, :body

      # @!parse attr_reader :job
      has :job

      def colorized_body
        attributes['colorized_body'] ||= body.gsub(/[^[:print:]\e\n]/, '')
      end

      def clean_body
        attributes['clean_body'] ||= colorized_body.gsub(/\e[^m]+m/, '')
      end

      one :artifact
      many :artifacts
      aka :log
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
travis-1.1.3 lib/travis/client/artifact.rb
travis-1.1.2 lib/travis/client/artifact.rb
travis-1.1.1 lib/travis/client/artifact.rb
travis-1.1.0 lib/travis/client/artifact.rb