Class: KalibroClient::Entities::Processor::Repository

Inherits:
Base
  • Object
show all
Defined in:
lib/kalibro_client/entities/processor/repository.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

address

Methods inherited from Base

#kalibro_errors, module_name

Instance Attribute Details

#addressObject

Returns the value of attribute address.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def address
  @address
end

#branchObject

Returns the value of attribute branch.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def branch
  @branch
end

#code_directoryObject

Returns the value of attribute code_directory.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def code_directory
  @code_directory
end

#descriptionObject

Returns the value of attribute description.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def description
  @description
end

#idObject

Returns the value of attribute id.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def id
  @id
end

#kalibro_configuration_idObject

Returns the value of attribute kalibro_configuration_id.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def kalibro_configuration_id
  @kalibro_configuration_id
end

#licenseObject

Returns the value of attribute license.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def license
  @license
end

#nameObject

Returns the value of attribute name.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def name
  @name
end

#periodObject

Returns the value of attribute period.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def period
  @period
end

#project_idObject

Returns the value of attribute project_id.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def project_id
  @project_id
end

#scm_typeObject

Returns the value of attribute scm_type.



22
23
24
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22

def scm_type
  @scm_type
end

Class Method Details

.branches(url, scm_type) ⇒ Object



115
116
117
# File 'lib/kalibro_client/entities/processor/repository.rb', line 115

def self.branches(url, scm_type)
  request("/branches", {url: url, scm_type: scm_type})
end

.repositories_of(project_id) ⇒ Object



28
29
30
# File 'lib/kalibro_client/entities/processor/repository.rb', line 28

def self.repositories_of(project_id)
  create_objects_array_from_hash(request('', {}, :get, "projects/#{project_id}"))
end

.repository_typesObject



24
25
26
# File 'lib/kalibro_client/entities/processor/repository.rb', line 24

def self.repository_types
  request('types', {}, :get)['types'].to_a
end

Instance Method Details

#cancel_processing_of_repositoryObject



52
53
54
# File 'lib/kalibro_client/entities/processor/repository.rb', line 52

def cancel_processing_of_repository
  self.class.request(':id/cancel_process', {id: self.id}, :get)
end

#first_processingObject



99
100
101
# File 'lib/kalibro_client/entities/processor/repository.rb', line 99

def first_processing
  Processing.new(self.class.request("#{self.id}/first_processing")['processing'])
end

#first_processing_after(date) ⇒ Object



107
108
109
# File 'lib/kalibro_client/entities/processor/repository.rb', line 107

def first_processing_after(date)
  Processing.new(self.class.request("#{self.id}/first_processing/after", {:date => date})["processing"])
end

#has_processingObject



75
76
77
# File 'lib/kalibro_client/entities/processor/repository.rb', line 75

def has_processing
  self.class.request("#{self.id}/has_processing", {}, :get)['has_processing']
end

#has_processing_after(date) ⇒ Object



83
84
85
# File 'lib/kalibro_client/entities/processor/repository.rb', line 83

def has_processing_after(date)
  self.class.request("#{self.id}/has_processing/after", {:date => date})['has_processing_in_time']
end

#has_processing_before(date) ⇒ Object



87
88
89
# File 'lib/kalibro_client/entities/processor/repository.rb', line 87

def has_processing_before(date)
  self.class.request("#{self.id}/has_processing/before", {:date => date})['has_processing_in_time']
end

#has_ready_processingObject



79
80
81
# File 'lib/kalibro_client/entities/processor/repository.rb', line 79

def has_ready_processing
  self.class.request("#{self.id}/has_ready_processing", {}, :get)['has_ready_processing']
end

#last_processingObject



103
104
105
# File 'lib/kalibro_client/entities/processor/repository.rb', line 103

def last_processing
  Processing.new(self.class.request("#{self.id}/last_processing")['processing'])
end

#last_processing_before(date) ⇒ Object



111
112
113
# File 'lib/kalibro_client/entities/processor/repository.rb', line 111

def last_processing_before(date)
  Processing.new(self.class.request("#{self.id}/last_processing/before", {:date => date})['processing'])
end

#last_processing_stateObject



91
92
93
# File 'lib/kalibro_client/entities/processor/repository.rb', line 91

def last_processing_state
  self.class.request("#{self.id}/last_processing_state", {}, :get)['processing_state']
end

#last_ready_processingObject



95
96
97
# File 'lib/kalibro_client/entities/processor/repository.rb', line 95

def last_ready_processing
  Processing.new(self.class.request(':id/last_ready_processing', {id: self.id}, :get)['last_ready_processing'])
end

#processObject



48
49
50
# File 'lib/kalibro_client/entities/processor/repository.rb', line 48

def process
  self.class.request("#{self.id}/process", {}, :get)
end

#processingObject



56
57
58
59
60
61
62
# File 'lib/kalibro_client/entities/processor/repository.rb', line 56

def processing
  if has_ready_processing
    last_ready_processing
  else
    last_processing
  end
end

#processing_with_date(date) ⇒ Object



64
65
66
67
68
69
70
71
72
73
# File 'lib/kalibro_client/entities/processor/repository.rb', line 64

def processing_with_date(date)
  date = date.is_a?(String) ? DateTime.parse(date) : date
  if has_processing_after(date)
    first_processing_after(date)
  elsif has_processing_before(date)
    last_processing_before(date)
  else
    nil
  end
end