Class: Jenkins::Client::Job

Inherits:
Object
  • Object
show all
Defined in:
lib/jenkins-client/job.rb

Class Method Summary collapse

Class Method Details

.allObject



6
7
8
9
# File 'lib/jenkins-client/job.rb', line 6

def self.all
  resp = Jenkins::Client.get "/api/json"
  resp.body.jobs
end

.create(name, config) ⇒ Object



15
16
17
# File 'lib/jenkins-client/job.rb', line 15

def self.create(name, config)
  Jenkins::Client.post("/createItem/api/xml?name=#{CGI.escape(name)}", config)
end

.find(name) ⇒ Object



11
12
13
# File 'lib/jenkins-client/job.rb', line 11

def self.find(name)
  all.select{|j| j.name == name}.first
end