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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6c651093055fa4f70cf6f1353451dd75262158c
4
- data.tar.gz: 2ab2060449ab84096802701738bc760a4ed25d2d
3
+ metadata.gz: a8a35b55e3e9052e2d77a36771badbbac87fabe5
4
+ data.tar.gz: 2760adecf3b8b465c4d44e77dbdf712ca4c8e460
5
5
  SHA512:
6
- metadata.gz: 93ec4ebf8b4416a25569e379ecee8be46a9723e5ee33644b3ce1e604961af090042b182e447b3fd74e7f23813d0adf82318028a64bd957e0c6db78cdf5b6f73e
7
- data.tar.gz: 948d62897e4a94c6c630e67834ff39b06906f8babb190c45009631d5478c1a0df872a40d16551d57736e33f0579a324e4acf527153395a61006a22e2da7472ba
6
+ metadata.gz: 82c77eefb5ce285cdb44d57148482548cb6fd3a1255cc2cae44dd9f7353f4afe86da95e59fd7c2eefd270bf433b074b747b890a1001a0cd57483bd445dd2d623
7
+ data.tar.gz: 9df971c7e8bc8a8a25d2a18451dacf4e52a2700af44d264227495ae3ff775c8be9003fd9fb48079cff0a284c08e21fbfc749c894669b90cb681521785f351847
data/README.md CHANGED
@@ -1,16 +1,21 @@
1
1
  # Kolekti
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/kolekti`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Code Climate](https://codeclimate.com/github/mezuro/kolekti.png)](https://codeclimate.com/github/mezuro/kalibro_client)
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
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
- ```ruby
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
- TODO: Write usage instructions here
30
+ You have one key class you need to extend `Kolekti::Collector` implementing the following methods:
26
31
 
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
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
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/kolekti.
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 = ["Rafael Reggiani Manzo"]
10
- spec.email = ["rr.manzo@gmail.com"]
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{Provides basic API for KalibroProcessor Collector}
14
- spec.description = %q{This gem defines how KalibroCollector expects his collectors to provide the parsed data so it can persist and process those results}
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
@@ -1,3 +1,3 @@
1
1
  module Kolekti
2
- VERSION = "0.0.1.alpha2"
2
+ VERSION = "0.0.1"
3
3
  end
data/lib/kolekti.rb CHANGED
@@ -2,6 +2,7 @@ require 'kolekti/version'
2
2
  require 'kolekti/collector'
3
3
  require 'kolekti/runner'
4
4
  require 'kolekti/persistence_strategy'
5
+ require 'kolekti/memory_persistence_strategy'
5
6
  require 'kolekti/errors'
6
7
 
7
8
  module Kolekti
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.alpha2
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: This gem defines how KalibroCollector expects his collectors to provide
140
- the parsed data so it can persist and process those results
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
- - rr.manzo@gmail.com
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: 1.3.1
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: Provides basic API for KalibroProcessor Collector
196
+ summary: Kolekti is a code metric results parser framework.
190
197
  test_files: []