kolekti 0.0.1.alpha2 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -14
- data/kolekti.gemspec +10 -4
- data/lib/kolekti/memory_persistence_strategy.rb +42 -0
- data/lib/kolekti/version.rb +1 -1
- data/lib/kolekti.rb +1 -0
- metadata +14 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8a35b55e3e9052e2d77a36771badbbac87fabe5
|
4
|
+
data.tar.gz: 2760adecf3b8b465c4d44e77dbdf712ca4c8e460
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82c77eefb5ce285cdb44d57148482548cb6fd3a1255cc2cae44dd9f7353f4afe86da95e59fd7c2eefd270bf433b074b747b890a1001a0cd57483bd445dd2d623
|
7
|
+
data.tar.gz: 9df971c7e8bc8a8a25d2a18451dacf4e52a2700af44d264227495ae3ff775c8be9003fd9fb48079cff0a284c08e21fbfc749c894669b90cb681521785f351847
|
data/README.md
CHANGED
@@ -1,16 +1,21 @@
|
|
1
1
|
# Kolekti
|
2
2
|
|
3
|
-
|
3
|
+
[![Code Climate](https://codeclimate.com/github/mezuro/kolekti.png)](https://codeclimate.com/github/mezuro/kalibro_client)
|
4
4
|
|
5
|
-
|
5
|
+
Kolekti is a code metric results parser framework. You can use it whenever you want structured unique output for different metric collectors.
|
6
|
+
|
7
|
+
## Contributing
|
8
|
+
|
9
|
+
Please, have a look the wiki pages about development workflow and code standards:
|
10
|
+
|
11
|
+
* https://github.com/mezuro/mezuro/wiki/Development-workflow
|
12
|
+
* https://github.com/mezuro/mezuro/wiki/Standards
|
6
13
|
|
7
14
|
## Installation
|
8
15
|
|
9
16
|
Add this line to your application's Gemfile:
|
10
17
|
|
11
|
-
|
12
|
-
gem 'kolekti'
|
13
|
-
```
|
18
|
+
gem 'kolekti'
|
14
19
|
|
15
20
|
And then execute:
|
16
21
|
|
@@ -22,15 +27,12 @@ Or install it yourself as:
|
|
22
27
|
|
23
28
|
## Usage
|
24
29
|
|
25
|
-
|
30
|
+
You have one key class you need to extend `Kolekti::Collector` implementing the following methods:
|
26
31
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
32
|
+
* `collect_metrics(code_directory, wanted_metric_configurations)`
|
33
|
+
* `clean(code_directory, wanted_metric_configurations)`
|
34
|
+
* `default_value_from(metric_configuration)`
|
34
35
|
|
35
|
-
|
36
|
+
Actual examples are:
|
36
37
|
|
38
|
+
* [KolektiAnalizo](https://github.com/mezuro/kolekti_analizo)
|
data/kolekti.gemspec
CHANGED
@@ -6,12 +6,18 @@ require 'kolekti/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "kolekti"
|
8
8
|
spec.version = Kolekti::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
|
9
|
+
spec.authors = ["Daniel Miranda",
|
10
|
+
"Diego Araújo",
|
11
|
+
"Eduardo Araújo",
|
12
|
+
"Rafael Reggiani Manzo"]
|
13
|
+
spec.email = ["danielkza2@gmail.com",
|
14
|
+
"diegoamc90@gmail.com",
|
15
|
+
"duduktamg@hotmail.com",
|
16
|
+
"rr.manzo@protonmail.com"]
|
11
17
|
spec.license = "LGPLv3"
|
12
18
|
|
13
|
-
spec.summary = %q{
|
14
|
-
spec.description = %q{
|
19
|
+
spec.summary = %q{Kolekti is a code metric results parser framework.}
|
20
|
+
spec.description = %q{Kolekti is a code metric results parser framework. You can use it whenever you want structured unique output for different metric collectors.}
|
15
21
|
spec.homepage = "https://github.com/mezuro/kolekti"
|
16
22
|
|
17
23
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Kolekti
|
2
|
+
class MemoryPersistenceStrategy < Kolekti::PersistenceStrategy
|
3
|
+
attr_reader :tree_metric_results, :hotspot_metric_results, :related_hotspot_metric_results
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@tree_metric_results = []
|
7
|
+
@hotspot_metric_results = []
|
8
|
+
@related_hotspot_metric_results = []
|
9
|
+
end
|
10
|
+
|
11
|
+
def create_tree_metric_result(metric_configuration, module_name, value, granularity)
|
12
|
+
@tree_metric_results << {
|
13
|
+
metric_configuration: metric_configuration,
|
14
|
+
module_name: module_name,
|
15
|
+
value: value,
|
16
|
+
granularity: granularity
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_hotspot_metric_result(metric_configuration, module_name, line, message)
|
21
|
+
result = {
|
22
|
+
metric_configuration: metric_configuration,
|
23
|
+
module_name: module_name,
|
24
|
+
line: line,
|
25
|
+
message: message
|
26
|
+
}
|
27
|
+
@hotspot_metric_results << result
|
28
|
+
result
|
29
|
+
end
|
30
|
+
|
31
|
+
def create_related_hotspot_metric_results(metric_configuration, results)
|
32
|
+
related_results = []
|
33
|
+
|
34
|
+
results.each do |result|
|
35
|
+
result = create_hotspot_metric_result(metric_configuration, result['module_name'], result['line'], result['message'])
|
36
|
+
related_results << result
|
37
|
+
end
|
38
|
+
|
39
|
+
related_hotspot_metric_results << related_results
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/lib/kolekti/version.rb
CHANGED
data/lib/kolekti.rb
CHANGED
metadata
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kolekti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Daniel Miranda
|
8
|
+
- Diego Araújo
|
9
|
+
- Eduardo Araújo
|
7
10
|
- Rafael Reggiani Manzo
|
8
11
|
autorequire:
|
9
12
|
bindir: exe
|
@@ -136,10 +139,13 @@ dependencies:
|
|
136
139
|
- - ">="
|
137
140
|
- !ruby/object:Gem::Version
|
138
141
|
version: '0'
|
139
|
-
description:
|
140
|
-
|
142
|
+
description: Kolekti is a code metric results parser framework. You can use it whenever
|
143
|
+
you want structured unique output for different metric collectors.
|
141
144
|
email:
|
142
|
-
-
|
145
|
+
- danielkza2@gmail.com
|
146
|
+
- diegoamc90@gmail.com
|
147
|
+
- duduktamg@hotmail.com
|
148
|
+
- rr.manzo@protonmail.com
|
143
149
|
executables: []
|
144
150
|
extensions: []
|
145
151
|
extra_rdoc_files: []
|
@@ -160,6 +166,7 @@ files:
|
|
160
166
|
- lib/kolekti.rb
|
161
167
|
- lib/kolekti/collector.rb
|
162
168
|
- lib/kolekti/errors.rb
|
169
|
+
- lib/kolekti/memory_persistence_strategy.rb
|
163
170
|
- lib/kolekti/persistence_strategy.rb
|
164
171
|
- lib/kolekti/runner.rb
|
165
172
|
- lib/kolekti/version.rb
|
@@ -178,13 +185,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
185
|
version: '0'
|
179
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
187
|
requirements:
|
181
|
-
- - "
|
188
|
+
- - ">="
|
182
189
|
- !ruby/object:Gem::Version
|
183
|
-
version:
|
190
|
+
version: '0'
|
184
191
|
requirements: []
|
185
192
|
rubyforge_project:
|
186
193
|
rubygems_version: 2.4.8
|
187
194
|
signing_key:
|
188
195
|
specification_version: 4
|
189
|
-
summary:
|
196
|
+
summary: Kolekti is a code metric results parser framework.
|
190
197
|
test_files: []
|