kalibro_gem 0.0.1.rc7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +21 -0
- data/AUTHORS +4 -0
- data/COPYING +674 -0
- data/COPYING.LESSER +165 -0
- data/Gemfile +4 -0
- data/README.md +77 -0
- data/Rakefile +6 -0
- data/cucumber.yml +1 -0
- data/features/base_tool/all_names.feature +8 -0
- data/features/base_tool/find_by_name.feature +12 -0
- data/features/configuration/all.feature +10 -0
- data/features/metric_configuration/find.feature +18 -0
- data/features/metric_configuration/metric_configurations_of.feature +18 -0
- data/features/metric_result/descendant_results.feature +19 -0
- data/features/metric_result/history_of.feature +20 -0
- data/features/metric_result/metric_results_of.feature +19 -0
- data/features/module_result/children.feature +18 -0
- data/features/module_result/find.feature +15 -0
- data/features/module_result/history_of.feature +11 -0
- data/features/processing/first_processing_after.feature +18 -0
- data/features/processing/first_processing_of.feature +18 -0
- data/features/processing/has_processing.feature +18 -0
- data/features/processing/has_processing_after.feature +18 -0
- data/features/processing/has_processing_before.feature +18 -0
- data/features/processing/has_ready_processing.feature +18 -0
- data/features/processing/last_processing_before.feature +18 -0
- data/features/processing/last_processing_of.feature +18 -0
- data/features/processing/last_processing_state_of.feature +18 -0
- data/features/processing/last_ready_processing_of.feature +18 -0
- data/features/processing/processing_of.feature +32 -0
- data/features/processing/processing_with_date_of.feature +32 -0
- data/features/project/all.feature +10 -0
- data/features/project/creation.feature +9 -0
- data/features/project/destroy.feature +10 -0
- data/features/project/exists.feature +9 -0
- data/features/project/find.feature +10 -0
- data/features/range/ranges_of.feature +22 -0
- data/features/range/save.feature +32 -0
- data/features/reading/find.feature +11 -0
- data/features/reading/readings_of.feature +11 -0
- data/features/reading_group/all.feature +10 -0
- data/features/repository/all.feature +14 -0
- data/features/repository/cancel_processing.feature +14 -0
- data/features/repository/exists.feature +14 -0
- data/features/repository/find.feature +14 -0
- data/features/repository/of.feature +15 -0
- data/features/repository/process.feature +16 -0
- data/features/repository/types.feature +9 -0
- data/features/step_definitions/base_tool_steps.rb +28 -0
- data/features/step_definitions/configuration_steps.rb +11 -0
- data/features/step_definitions/metric_configuration_steps.rb +52 -0
- data/features/step_definitions/metric_result_steps.rb +29 -0
- data/features/step_definitions/metric_steps.rb +3 -0
- data/features/step_definitions/module_result_steps.rb +30 -0
- data/features/step_definitions/processing_steps.rb +91 -0
- data/features/step_definitions/project_steps.rb +48 -0
- data/features/step_definitions/range_steps.rb +41 -0
- data/features/step_definitions/reading_group_steps.rb +19 -0
- data/features/step_definitions/reading_steps.rb +20 -0
- data/features/step_definitions/repository_steps.rb +61 -0
- data/features/support/env.rb +25 -0
- data/features/support/kalibro_cucumber_helpers.yml.sample +10 -0
- data/kalibro_gem.gemspec +48 -0
- data/lib/kalibro_gem.rb +61 -0
- data/lib/kalibro_gem/entities.rb +37 -0
- data/lib/kalibro_gem/entities/base_tool.rb +54 -0
- data/lib/kalibro_gem/entities/configuration.rb +33 -0
- data/lib/kalibro_gem/entities/date_metric_result.rb +39 -0
- data/lib/kalibro_gem/entities/date_module_result.rb +39 -0
- data/lib/kalibro_gem/entities/metric.rb +21 -0
- data/lib/kalibro_gem/entities/metric_configuration.rb +70 -0
- data/lib/kalibro_gem/entities/metric_configuration_snapshot.rb +57 -0
- data/lib/kalibro_gem/entities/metric_result.rb +74 -0
- data/lib/kalibro_gem/entities/model.rb +162 -0
- data/lib/kalibro_gem/entities/module.rb +27 -0
- data/lib/kalibro_gem/entities/module_result.rb +77 -0
- data/lib/kalibro_gem/entities/process_time.rb +31 -0
- data/lib/kalibro_gem/entities/processing.rb +113 -0
- data/lib/kalibro_gem/entities/project.rb +34 -0
- data/lib/kalibro_gem/entities/range.rb +75 -0
- data/lib/kalibro_gem/entities/range_snapshot.rb +37 -0
- data/lib/kalibro_gem/entities/reading.rb +51 -0
- data/lib/kalibro_gem/entities/reading_group.rb +43 -0
- data/lib/kalibro_gem/entities/repository.rb +86 -0
- data/lib/kalibro_gem/entities/repository_observer.rb +50 -0
- data/lib/kalibro_gem/entities/stack_trace_element.rb +31 -0
- data/lib/kalibro_gem/entities/throwable.rb +42 -0
- data/lib/kalibro_gem/errors.rb +18 -0
- data/lib/kalibro_gem/errors/record_not_found.rb +22 -0
- data/lib/kalibro_gem/errors/standard.rb +24 -0
- data/lib/kalibro_gem/helpers/aggregation_options.rb +25 -0
- data/lib/kalibro_gem/helpers/hash_converters.rb +48 -0
- data/lib/kalibro_gem/helpers/request_methods.rb +47 -0
- data/lib/kalibro_gem/helpers/xml_converters.rb +20 -0
- data/lib/kalibro_gem/kalibro_cucumber_helpers.rb +40 -0
- data/lib/kalibro_gem/kalibro_cucumber_helpers/configuration.rb +39 -0
- data/lib/kalibro_gem/kalibro_cucumber_helpers/hooks.rb +50 -0
- data/lib/kalibro_gem/kalibro_cucumber_helpers/scripts/delete_all_kalibro_entries.sh +23 -0
- data/lib/kalibro_gem/kalibro_cucumber_helpers/scripts/prepare_kalibro_query_file.sh +38 -0
- data/lib/kalibro_gem/kalibro_cucumber_helpers/scripts/put_kalibro_on_test_mode.sh +35 -0
- data/lib/kalibro_gem/kalibro_cucumber_helpers/scripts/return_kalibro_from_test_mode.sh +26 -0
- data/lib/kalibro_gem/version.rb +19 -0
- data/lib/rake/test_task.rb +57 -0
- data/spec/entities/base_tool_spec.rb +168 -0
- data/spec/entities/configuration_spec.rb +61 -0
- data/spec/entities/date_metric_result_spec.rb +62 -0
- data/spec/entities/date_module_result_spec.rb +61 -0
- data/spec/entities/metric_configuration_snapshot_spec.rb +107 -0
- data/spec/entities/metric_configuration_spec.rb +149 -0
- data/spec/entities/metric_result_spec.rb +201 -0
- data/spec/entities/metric_spec.rb +47 -0
- data/spec/entities/model_spec.rb +275 -0
- data/spec/entities/module_result_spec.rb +163 -0
- data/spec/entities/process_time_spec.rb +33 -0
- data/spec/entities/processing_spec.rb +334 -0
- data/spec/entities/project_spec.rb +68 -0
- data/spec/entities/range_snapshot_spec.rb +50 -0
- data/spec/entities/range_spec.rb +181 -0
- data/spec/entities/reading_group_spec.rb +90 -0
- data/spec/entities/reading_spec.rb +106 -0
- data/spec/entities/repository_observer_spec.rb +123 -0
- data/spec/entities/repository_spec.rb +191 -0
- data/spec/entities/stack_trace_element_spec.rb +26 -0
- data/spec/entities/throwable_spec.rb +51 -0
- data/spec/factories/base_tools.rb +31 -0
- data/spec/factories/configurations.rb +29 -0
- data/spec/factories/date_metric_results.rb +28 -0
- data/spec/factories/date_module_results.rb +22 -0
- data/spec/factories/metric_configurations.rb +28 -0
- data/spec/factories/metric_configurations_snapshot.rb +26 -0
- data/spec/factories/metric_results.rb +24 -0
- data/spec/factories/metrics.rb +35 -0
- data/spec/factories/models.rb +20 -0
- data/spec/factories/module_results.rb +33 -0
- data/spec/factories/modules.rb +22 -0
- data/spec/factories/process_times.rb +27 -0
- data/spec/factories/processings.rb +25 -0
- data/spec/factories/projects.rb +29 -0
- data/spec/factories/ranges.rb +30 -0
- data/spec/factories/ranges_snapshot.rb +26 -0
- data/spec/factories/reading_groups.rb +23 -0
- data/spec/factories/readings.rb +25 -0
- data/spec/factories/repositories.rb +34 -0
- data/spec/factories/repository_observers.rb +24 -0
- data/spec/factories/stack_trace_elements.rb +24 -0
- data/spec/factories/throwables.rb +23 -0
- data/spec/helpers/aggregation_options_spec.rb +31 -0
- data/spec/helpers/hash_converters_spec.rb +111 -0
- data/spec/helpers/xml_converters_spec.rb +64 -0
- data/spec/kalibro_entities_spec.rb +108 -0
- data/spec/savon/fixtures/config.yml +1 -0
- data/spec/savon/fixtures/invalid_config.yml +2 -0
- data/spec/savon/fixtures/project/does_not_exists.xml +1 -0
- data/spec/savon/savon_test_helper.rb +14 -0
- data/spec/spec_helper.rb +60 -0
- metadata +463 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
# This file is part of KalibroGem
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require "kalibro_gem/entities/model"
|
18
|
+
|
19
|
+
module KalibroGem
|
20
|
+
module Entities
|
21
|
+
class Project < Model
|
22
|
+
|
23
|
+
attr_accessor :id, :name, :description
|
24
|
+
|
25
|
+
def id=(value)
|
26
|
+
@id = value.to_i
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.all
|
30
|
+
create_objects_array_from_hash request(:all_projects)[:project]
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# This file is part of KalibroGem
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require "kalibro_gem/entities/model"
|
18
|
+
|
19
|
+
module KalibroGem
|
20
|
+
module Entities
|
21
|
+
class Range < Model
|
22
|
+
|
23
|
+
attr_accessor :id, :beginning, :end, :reading_id, :comments
|
24
|
+
|
25
|
+
def id=(value)
|
26
|
+
@id = value.to_i
|
27
|
+
end
|
28
|
+
|
29
|
+
def reading_id=(value)
|
30
|
+
@reading_id = value.to_i
|
31
|
+
end
|
32
|
+
|
33
|
+
def beginning=(value)
|
34
|
+
@beginning = value == "-INF" ? value : value.to_f
|
35
|
+
end
|
36
|
+
|
37
|
+
def end=(value)
|
38
|
+
@end = value == "INF" ? value : value.to_f
|
39
|
+
end
|
40
|
+
|
41
|
+
def label
|
42
|
+
reading.label
|
43
|
+
end
|
44
|
+
|
45
|
+
def grade
|
46
|
+
reading.grade
|
47
|
+
end
|
48
|
+
|
49
|
+
def color
|
50
|
+
reading.color
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.ranges_of(metric_configuration_id)
|
54
|
+
self.create_objects_array_from_hash request(:ranges_of, {metric_configuration_id: metric_configuration_id} )[:range]
|
55
|
+
end
|
56
|
+
|
57
|
+
def save(metric_configuration_id)
|
58
|
+
begin
|
59
|
+
@id = self.class.request(:save_range, {:range => self.to_hash, :metric_configuration_id => metric_configuration_id})[:range_id]
|
60
|
+
true
|
61
|
+
rescue Exception => exception
|
62
|
+
add_error exception
|
63
|
+
false
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
private
|
68
|
+
|
69
|
+
def reading
|
70
|
+
@reading ||= KalibroGem::Entities::Reading.find(reading_id)
|
71
|
+
@reading
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# This file is part of KalibroGem
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require "kalibro_gem/entities/model"
|
18
|
+
|
19
|
+
module KalibroGem
|
20
|
+
module Entities
|
21
|
+
class RangeSnapshot < Model
|
22
|
+
attr_accessor :beginning, :end, :label, :grade, :color, :comments
|
23
|
+
|
24
|
+
def beginning=(value)
|
25
|
+
@beginning = ((value == "-INF") ? -1.0/0 : value.to_f)
|
26
|
+
end
|
27
|
+
|
28
|
+
def end=(value)
|
29
|
+
@end = ((value == "INF") ? 1.0/0 : value.to_f)
|
30
|
+
end
|
31
|
+
|
32
|
+
def grade=(value)
|
33
|
+
@grade = value.to_f
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# This file is part of KalibroGem
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
module KalibroGem
|
18
|
+
module Entities
|
19
|
+
class Reading < Model
|
20
|
+
|
21
|
+
attr_accessor :id, :label, :grade, :color, :group_id
|
22
|
+
|
23
|
+
def id=(value)
|
24
|
+
@id = value.to_i
|
25
|
+
end
|
26
|
+
|
27
|
+
def grade=(value)
|
28
|
+
@grade = value.to_f
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.find(id)
|
32
|
+
begin
|
33
|
+
new request(:get_reading, {:reading_id => id})[:reading]
|
34
|
+
rescue Savon::SOAPFault
|
35
|
+
raise KalibroGem::Errors::RecordNotFound
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.readings_of(group_id)
|
40
|
+
create_objects_array_from_hash request(:readings_of, {:group_id => group_id})[:reading]
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def save_params
|
46
|
+
{:reading => self.to_hash, :group_id => group_id}
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# This file is part of KalibroGem
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
module KalibroGem
|
18
|
+
module Entities
|
19
|
+
class ReadingGroup < Model
|
20
|
+
|
21
|
+
attr_accessor :id, :name, :description
|
22
|
+
|
23
|
+
def id=(value)
|
24
|
+
@id = value.to_i
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.all
|
28
|
+
create_objects_array_from_hash request(:all_reading_groups)[:reading_group]
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def self.id_params(id)
|
34
|
+
{:group_id => id}
|
35
|
+
end
|
36
|
+
|
37
|
+
def destroy_params
|
38
|
+
{:group_id => self.id}
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# This file is part of KalibroGem
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require "kalibro_gem/entities/model"
|
18
|
+
|
19
|
+
module KalibroGem
|
20
|
+
module Entities
|
21
|
+
class Repository < Model
|
22
|
+
|
23
|
+
attr_accessor :id, :name, :description, :license, :process_period, :type, :address, :configuration_id, :project_id, :send_email
|
24
|
+
|
25
|
+
def self.repository_types
|
26
|
+
request(:supported_repository_types)[:supported_type].to_a
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.repositories_of(project_id)
|
30
|
+
repositories = create_objects_array_from_hash request(:repositories_of, {:project_id => project_id})[:repository]
|
31
|
+
repositories.map { |repository| repository.project_id = project_id; repository }
|
32
|
+
end
|
33
|
+
|
34
|
+
def id=(value)
|
35
|
+
@id = value.to_i
|
36
|
+
end
|
37
|
+
|
38
|
+
def process_period=(value)
|
39
|
+
@process_period = value.to_i
|
40
|
+
end
|
41
|
+
|
42
|
+
def configuration_id=(value)
|
43
|
+
@configuration_id = value.to_i
|
44
|
+
end
|
45
|
+
|
46
|
+
def process
|
47
|
+
self.class.request(:process_repository, {:repository_id => self.id})
|
48
|
+
end
|
49
|
+
|
50
|
+
def cancel_processing_of_repository
|
51
|
+
self.class.request(:cancel_processing_of_repository, {:repository_id => self.id})
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.all
|
55
|
+
projects = Project.all
|
56
|
+
repositories = []
|
57
|
+
|
58
|
+
projects.each do |project|
|
59
|
+
repositories.concat(repositories_of(project.id))
|
60
|
+
end
|
61
|
+
|
62
|
+
return repositories
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.find(id)
|
66
|
+
all.each { |repository| return repository if repository.id == id }
|
67
|
+
|
68
|
+
raise KalibroGem::Errors::RecordNotFound
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.exists?(id)
|
72
|
+
begin
|
73
|
+
return true unless find(id).nil?
|
74
|
+
rescue KalibroGem::Errors::RecordNotFound
|
75
|
+
return false
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def save_params
|
82
|
+
{:repository => self.to_hash, :project_id => project_id}
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# This file is part of KalibroGem
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require "kalibro_gem/entities/model"
|
18
|
+
|
19
|
+
module KalibroGem
|
20
|
+
module Entities
|
21
|
+
class RepositoryObserver < Model
|
22
|
+
attr_accessor :id, :repository_id, :name, :email
|
23
|
+
|
24
|
+
def id=(value)
|
25
|
+
@id = value.to_i
|
26
|
+
end
|
27
|
+
|
28
|
+
def repository_id=(value)
|
29
|
+
@repository_id = value.to_i
|
30
|
+
end
|
31
|
+
|
32
|
+
def name=(value)
|
33
|
+
@name = value
|
34
|
+
end
|
35
|
+
|
36
|
+
def email=(value)
|
37
|
+
@email = value
|
38
|
+
end
|
39
|
+
|
40
|
+
# FIXME: the index of the second parameter of the request must be repository_id. It can't be fixed here until Kalibro webservice remain with this name!
|
41
|
+
def self.repository_observers_of(value)
|
42
|
+
create_objects_array_from_hash request(:repository_observers_of, {:repository_observer_id => value})[:repository_observer]
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.all
|
46
|
+
create_objects_array_from_hash request(:all_repository_observers)[:repository_observer]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file is part of KalibroGem
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require "kalibro_gem/entities/model"
|
18
|
+
|
19
|
+
module KalibroGem
|
20
|
+
module Entities
|
21
|
+
class StackTraceElement < Model
|
22
|
+
|
23
|
+
attr_accessor :declaring_class, :method_name, :file_name, :line_number
|
24
|
+
|
25
|
+
def line_number=(value)
|
26
|
+
@line_number = value.to_i
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# This file is part of KalibroGem
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require "kalibro_gem/entities/model"
|
18
|
+
|
19
|
+
module KalibroGem
|
20
|
+
module Entities
|
21
|
+
class Throwable < Model
|
22
|
+
|
23
|
+
attr_accessor :target_string, :message, :cause, :stack_trace_element
|
24
|
+
|
25
|
+
def stack_trace_element=(value)
|
26
|
+
@stack_trace_element = KalibroGem::Entities::StackTraceElement.to_objects_array value
|
27
|
+
end
|
28
|
+
|
29
|
+
def stack_trace
|
30
|
+
@stack_trace_element
|
31
|
+
end
|
32
|
+
|
33
|
+
def stack_trace=(stack_trace)
|
34
|
+
@stack_trace_element = stack_trace
|
35
|
+
end
|
36
|
+
|
37
|
+
def cause=(cause_value)
|
38
|
+
@cause = KalibroGem::Entities::Throwable.to_object cause_value
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|