Sha256: 2b27dfb368c48c9cb13b09b746c5187d651deb90ec2181d1584e741020c23a30

Contents?: true

Size: 1.2 KB

Versions: 243

Compression:

Stored size: 1.2 KB

Contents

require 'travis/client'

module Travis
  module Client
    class Build < Entity
      include States, Restartable
      preloadable

      # @!parse attr_reader :repository_id, :commit_id, :number, :pull_request, :pull_request_number, :pull_request_title, :config, :state, :started_at, :finished_at, :duration, :job_ids
      attributes :repository_id, :commit_id, :number, :pull_request, :pull_request_number, :pull_request_title, :config, :state, :started_at, :finished_at, :duration, :job_ids
      time :started_at, :finished_at

      alias pull_request? pull_request
      alias pr_number pull_request_number

      # @!parse attr_reader :repository, :commit, :jobs
      has :repository, :commit, :jobs

      one :build
      many :builds
      aka :branch, :branches

      def delete_logs(reason = {})
        jobs.each do |job|
          job.delete_log(reason)
        end
      end

      def push?
        not pull_request?
      end

      def branch_info
        info = commit.branch
        pull_request? ? info + " (PR ##{pr_number})" : info
      end

      def pusher_channels
        repository.pusher_channels
      end

      def inspect_info
        "#{repository.slug}##{number}"
      end
    end
  end
end

Version data entries

243 entries across 243 versions & 3 rubygems

Version Path
travis-1.8.12.travis.1101.9 lib/travis/client/build.rb
travis-1.8.11 lib/travis/client/build.rb
travis-1.8.11.travis.1098.9 lib/travis/client/build.rb
travis-1.8.11.travis.1081.9 lib/travis/client/build.rb
travis-1.8.11.travis.1059.11 lib/travis/client/build.rb
travis-1.8.11.travis.1058.11 lib/travis/client/build.rb
travis-1.8.11.travis.1056.11 lib/travis/client/build.rb
travis-1.8.11.travis.1051.11 lib/travis/client/build.rb
travis-1.8.11.travis.1048.11 lib/travis/client/build.rb
travis-1.8.11.travis.1044.11 lib/travis/client/build.rb
travis-1.8.11.travis.1041.11 lib/travis/client/build.rb
travis-1.8.11.travis.1040.11 lib/travis/client/build.rb
travis-1.8.11.travis.1026.11 lib/travis/client/build.rb
travis-1.8.11.travis.1025.11 lib/travis/client/build.rb
travis-1.8.11.travis.1024.11 lib/travis/client/build.rb
travis-1.8.11.travis.1022.11 lib/travis/client/build.rb
travis-1.8.11.travis.1021.11 lib/travis/client/build.rb
travis-1.8.11.travis.1020.11 lib/travis/client/build.rb
travis-1.8.11.travis.1012.9 lib/travis/client/build.rb
travis-1.8.11.travis.1011.9 lib/travis/client/build.rb