Class: LeeroyJenkins::JobBackupper

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job_names_to_backup, jenkins_client, backup_dir, threads) ⇒ JobBackupper

Returns a new instance of JobBackupper.



5
6
7
8
9
10
# File 'lib/leeroy_jenkins/job_backupper.rb', line 5

def initialize(job_names_to_backup, jenkins_client, backup_dir, threads)
  @job_names_to_backup = job_names_to_backup
  @jenkins_client = jenkins_client
  @backup_dir = backup_dir
  @threads = threads
end

Instance Attribute Details

#backup_dirObject (readonly)

Returns the value of attribute backup_dir.



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

def backup_dir
  @backup_dir
end

#jenkins_clientObject (readonly)

Returns the value of attribute jenkins_client.



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

def jenkins_client
  @jenkins_client
end

#job_names_to_backupObject (readonly)

Returns the value of attribute job_names_to_backup.



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

def job_names_to_backup
  @job_names_to_backup
end

#threadsObject (readonly)

Returns the value of attribute threads.



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

def threads
  @threads
end

Instance Method Details

#backup(dry = true) ⇒ Object



12
13
14
# File 'lib/leeroy_jenkins/job_backupper.rb', line 12

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