Sha256: cd6efdfc905fb60c4306b092b074521fbc220011af21e11a198e3a8c140eace1

Contents?: true

Size: 1.05 KB

Versions: 54

Compression:

Stored size: 1.05 KB

Contents

require 'travis/client'

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

      # @!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
        pull_request? ? "Pull Request ##{pr_number}" : commit.branch
      end

      def pusher_channels
        repository.pusher_channels
      end

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

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
travis-1.5.6.travis.330.4 lib/travis/client/build.rb
travis-1.5.6.travis.329.4 lib/travis/client/build.rb
travis-1.5.6.travis.326.4 lib/travis/client/build.rb
travis-1.5.6.travis.324.4 lib/travis/client/build.rb
travis-1.5.6.travis.323.4 lib/travis/client/build.rb
travis-1.5.6.travis.320.4 lib/travis/client/build.rb
travis-1.5.6.travis.319.4 lib/travis/client/build.rb
travis-1.5.6.travis.317.4 lib/travis/client/build.rb
travis-1.5.6.travis.315.4 lib/travis/client/build.rb
travis-1.5.6.travis.314.4 lib/travis/client/build.rb
travis-1.5.6.travis.312.4 lib/travis/client/build.rb
travis-1.5.6.travis.307.4 lib/travis/client/build.rb
travis-1.5.6.travis.306.4 lib/travis/client/build.rb
travis-1.5.6.travis.304.4 lib/travis/client/build.rb