kolekti 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +4 -0
- data/README.md +4 -0
- data/lib/kolekti/collector.rb +1 -1
- data/lib/kolekti/version.rb +1 -1
- data/lib/kolekti.rb +11 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35c62c82a9b9cfb081e6be5f6a1b28b24c5a67a5
|
4
|
+
data.tar.gz: 1c6045bc9c8084c38ee7a6ccacd9096a50ce939f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99ecb31c96ddf973c80a95900a8ea032a0adfeb4105880cc5cfe6c479339678bf2cce0c912a6d37962bbe0b5b069503e518ba6a2f112fe6177332f64e5eaf6f7
|
7
|
+
data.tar.gz: 67d6b94012a490922a7c375fd6d89f3e3916418bbc28dd69e0e422264862fe0ee552de14fb4ed4a92750576572eca7b5885aa10b2791217b4f8526dcede12fdd
|
data/CHANGELOG.rdoc
CHANGED
@@ -4,6 +4,10 @@ The Kolekti gem provides a basic API for KalibroProcessor's collectors
|
|
4
4
|
|
5
5
|
== Unreleased
|
6
6
|
|
7
|
+
== v1.0.0 - 01/03/2016
|
8
|
+
|
9
|
+
Only register collectors if they are available and not already registered
|
10
|
+
|
7
11
|
== v0.0.2 - 24/02/2016
|
8
12
|
|
9
13
|
Add backport for Array#to_h on ruby-2.0.0-p598
|
data/README.md
CHANGED
@@ -36,3 +36,7 @@ You have one key class you need to extend `Kolekti::Collector` implementing the
|
|
36
36
|
Actual examples are:
|
37
37
|
|
38
38
|
* [KolektiAnalizo](https://github.com/mezuro/kolekti_analizo)
|
39
|
+
|
40
|
+
## Versioning
|
41
|
+
|
42
|
+
Kolekti follows the [semantic versioning](http://semver.org/) policy.
|
data/lib/kolekti/collector.rb
CHANGED
data/lib/kolekti/version.rb
CHANGED
data/lib/kolekti.rb
CHANGED
@@ -9,20 +9,17 @@ module Kolekti
|
|
9
9
|
COLLECTORS = []
|
10
10
|
|
11
11
|
def self.register_collector(collector)
|
12
|
-
COLLECTORS << collector
|
12
|
+
COLLECTORS << collector.new if collector.available? && !already_included?(collector)
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.collectors
|
16
16
|
COLLECTORS
|
17
17
|
end
|
18
18
|
|
19
|
-
def self.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
def self.available_collectors
|
25
|
-
collectors.select(&:available?)
|
19
|
+
def self.deregister_collector(collector)
|
20
|
+
to_be_deregistered_index = COLLECTORS.find_index { |kollector| kollector.is_a?(collector) }
|
21
|
+
raise ArgumentError.new("Collector #{collector} was not registered!") if to_be_deregistered_index.nil?
|
22
|
+
COLLECTORS.delete_at(to_be_deregistered_index)
|
26
23
|
end
|
27
24
|
|
28
25
|
def self.default_metric_value(metric_configuration)
|
@@ -33,4 +30,10 @@ module Kolekti
|
|
33
30
|
|
34
31
|
collector.default_value_from(metric_configuration)
|
35
32
|
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def self.already_included?(collector)
|
37
|
+
COLLECTORS.any? { |kollector| kollector.is_a?(collector) }
|
38
|
+
end
|
36
39
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kolekti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Miranda
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-
|
14
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: kalibro_client
|