Class: KalibroClient::Entities::Processor::Repository
- Inherits:
-
Base
- Object
- Base
- Base
- KalibroClient::Entities::Processor::Repository
show all
- Defined in:
- lib/kalibro_client/entities/processor/repository.rb
Instance Attribute Summary collapse
#created_at, #updated_at
Attributes inherited from Base
#kalibro_errors, #persisted
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
address
Methods inherited from Base
#==, create, create_array_from_hash, create_objects_array_from_hash, #destroy, exists?, find, #initialize, request, #save, #save!, #to_hash, to_object, to_objects_array, #update
#exists_action, #find_action, #id_params
#convert_to_hash, #date_with_milliseconds, #field_to_hash
#get_xml, #xml_instance_class_name
#destroy_action, #destroy_params, #destroy_prefix, #save_action, #save_prefix, #update_params, #update_prefix
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
22
23
24
|
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22
def address
@address
end
|
#branch ⇒ Object
Returns the value of attribute branch.
22
23
24
|
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22
def branch
@branch
end
|
#code_directory ⇒ Object
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
|
#description ⇒ Object
Returns the value of attribute description.
22
23
24
|
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22
def description
@description
end
|
#id ⇒ Object
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_id ⇒ Object
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
|
#license ⇒ Object
Returns the value of attribute license.
22
23
24
|
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22
def license
@license
end
|
#name ⇒ Object
Returns the value of attribute name.
22
23
24
|
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22
def name
@name
end
|
#period ⇒ Object
Returns the value of attribute period.
22
23
24
|
# File 'lib/kalibro_client/entities/processor/repository.rb', line 22
def period
@period
end
|
#project_id ⇒ Object
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_type ⇒ Object
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
.all ⇒ Object
115
116
117
|
# File 'lib/kalibro_client/entities/processor/repository.rb', line 115
def self.all
create_objects_array_from_hash(request("", {}, :get))
end
|
.branches(url, scm_type) ⇒ Object
119
120
121
|
# File 'lib/kalibro_client/entities/processor/repository.rb', line 119
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_types ⇒ Object
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_repository ⇒ Object
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_processing ⇒ Object
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_processing ⇒ Object
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_processing ⇒ Object
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_processing ⇒ Object
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_state ⇒ Object
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_processing ⇒ Object
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
|
#process ⇒ Object
48
49
50
|
# File 'lib/kalibro_client/entities/processor/repository.rb', line 48
def process
self.class.request("#{self.id}/process", {}, :get)
end
|
#processing ⇒ Object
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
|