Class: LeeroyJenkins::JobUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/leeroy_jenkins/job_updater.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job_names_to_update, new_xml, jenkins_client, xpath, at_xpath, threads) ⇒ JobUpdater

Returns a new instance of JobUpdater.



10
11
12
13
14
15
16
17
# File 'lib/leeroy_jenkins/job_updater.rb', line 10

def initialize(job_names_to_update, new_xml, jenkins_client, xpath, at_xpath, threads)
  @job_names_to_update = job_names_to_update
  @new_xml = new_xml
  @jenkins_client = jenkins_client
  @xpath = xpath
  @at_xpath = at_xpath
  @threads = threads
end

Instance Attribute Details

#at_xpathObject (readonly)

Returns the value of attribute at_xpath.



3
4
5
# File 'lib/leeroy_jenkins/job_updater.rb', line 3

def at_xpath
  @at_xpath
end

#jenkins_clientObject (readonly)

Returns the value of attribute jenkins_client.



3
4
5
# File 'lib/leeroy_jenkins/job_updater.rb', line 3

def jenkins_client
  @jenkins_client
end

#job_names_to_updateObject (readonly)

Returns the value of attribute job_names_to_update.



3
4
5
# File 'lib/leeroy_jenkins/job_updater.rb', line 3

def job_names_to_update
  @job_names_to_update
end

#new_xmlObject (readonly)

Returns the value of attribute new_xml.



3
4
5
# File 'lib/leeroy_jenkins/job_updater.rb', line 3

def new_xml
  @new_xml
end

#threadsObject (readonly)

Returns the value of attribute threads.



3
4
5
# File 'lib/leeroy_jenkins/job_updater.rb', line 3

def threads
  @threads
end

#xpathObject (readonly)

Returns the value of attribute xpath.



3
4
5
# File 'lib/leeroy_jenkins/job_updater.rb', line 3

def xpath
  @xpath
end

Instance Method Details

#update_jobs(dry = true) ⇒ Object



19
20
21
# File 'lib/leeroy_jenkins/job_updater.rb', line 19

def update_jobs(dry = true)
  Result.new(dry ? dry_run : update_jobs!)
end