Sha256: eed6143a7df4698f4156175d78a6ffe4b471901c78f96f34860fa0ceb3350669

Contents?: true

Size: 1.09 KB

Versions: 60

Compression:

Stored size: 1.09 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 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

60 entries across 60 versions & 1 rubygems

Version Path
travis-1.6.9.travis.461.6 lib/travis/client/build.rb
travis-1.6.9.travis.458.6 lib/travis/client/build.rb
travis-1.6.8 lib/travis/client/build.rb
travis-1.6.8.travis.457.6 lib/travis/client/build.rb
travis-1.6.8.travis.456.6 lib/travis/client/build.rb
travis-1.6.8.travis.455.6 lib/travis/client/build.rb
travis-1.6.8.travis.454.6 lib/travis/client/build.rb
travis-1.6.8.travis.453.6 lib/travis/client/build.rb
travis-1.6.8.travis.452.6 lib/travis/client/build.rb
travis-1.6.8.travis.451.6 lib/travis/client/build.rb
travis-1.6.8.travis.450.6 lib/travis/client/build.rb
travis-1.6.8.travis.449.6 lib/travis/client/build.rb
travis-1.6.8.travis.447.6 lib/travis/client/build.rb
travis-1.6.7.travis.446.6 lib/travis/client/build.rb
travis-1.6.7 lib/travis/client/build.rb
travis-1.6.7.travis.445.6 lib/travis/client/build.rb
travis-1.6.7.travis.443.6 lib/travis/client/build.rb
travis-1.6.7.travis.442.6 lib/travis/client/build.rb
travis-1.6.7.travis.441.6 lib/travis/client/build.rb
travis-1.6.7.travis.434.6 lib/travis/client/build.rb