Class: Travis::Client::Build

Inherits:
Entity
  • Object
show all
Includes:
Restartable, States
Defined in:
lib/travis/client/build.rb

Constant Summary

Constants included from States

States::STATES

Constants inherited from Entity

Entity::MAP

Instance Attribute Summary collapse

Attributes inherited from Entity

#attributes, #curry, #id, #session

Instance Method Summary collapse

Methods included from States

#canceled?, #color, #created?, #errored?, #failed?, #finished?, #green?, #passed?, #pending?, #queued?, #ready?, #red?, #running?, #started?, #unsuccessful?, #yellow?

Methods included from Restartable

#cancel, #cancelable?, #restart, #restartable?

Methods inherited from Entity

#[], #[]=, aka, #attribute_names, attributes, #cancelable?, cast_id, #complete?, has, #include?, #initialize, #inspect, inspect_info, #load, many, #missing?, one, relations, #relations, #reload, #restartable?, subclass_for, subclasses, time, #update_attributes

Constructor Details

This class inherits a constructor from Travis::Client::Entity

Instance Attribute Details

#commitObject (readonly)

Returns the value of attribute commit.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def commit
  @commit
end

#commit_idObject (readonly)

Returns the value of attribute commit_id.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def commit_id
  @commit_id
end

#configObject (readonly)

Returns the value of attribute config.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def config
  @config
end

#durationObject (readonly)

Returns the value of attribute duration.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def duration
  @duration
end

#finished_atObject (readonly)

Returns the value of attribute finished_at.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def finished_at
  @finished_at
end

#job_idsObject (readonly)

Returns the value of attribute job_ids.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def job_ids
  @job_ids
end

#jobsObject (readonly)

Returns the value of attribute jobs.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def jobs
  @jobs
end

#numberObject (readonly)

Returns the value of attribute number.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def number
  @number
end

#pull_requestObject (readonly) Also known as: pull_request?

Returns the value of attribute pull_request.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def pull_request
  @pull_request
end

#repositoryObject (readonly)

Returns the value of attribute repository.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def repository
  @repository
end

#repository_idObject (readonly)

Returns the value of attribute repository_id.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def repository_id
  @repository_id
end

#started_atObject (readonly)

Returns the value of attribute started_at.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def started_at
  @started_at
end

#stateObject (readonly)

Returns the value of attribute state.



1
2
3
# File 'lib/travis/client/build.rb', line 1

def state
  @state
end

Instance Method Details

#branch_infoObject



29
30
31
# File 'lib/travis/client/build.rb', line 29

def branch_info
  pull_request? ? "Pull Request ##{pr_number}" : commit.branch
end

#inspect_infoObject



37
38
39
# File 'lib/travis/client/build.rb', line 37

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

#pr_numberObject



25
26
27
# File 'lib/travis/client/build.rb', line 25

def pr_number
  commit.compare_url[/\d+$/] if pull_request?
end

#push?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/travis/client/build.rb', line 21

def push?
  not pull_request?
end

#pusher_channelsObject



33
34
35
# File 'lib/travis/client/build.rb', line 33

def pusher_channels
  repository.pusher_channels
end