kalibro_client 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e730f4e5ad4962f11f45d31b13285b451613196
4
- data.tar.gz: 5ee7728dfa0e8b72ad71c00cc3e25ec17663adb5
3
+ metadata.gz: 31aabdda1cc6f38edd2933a2677c99705a64f153
4
+ data.tar.gz: b847a2319acc4eeb0adccf34c4acde810c1eee92
5
5
  SHA512:
6
- metadata.gz: e35efd43bddb4bffbcb0b90e16723457507a7bf8723fd3ab305b37ac6636cd1f41ddd5cb05985ac9c02947ee8a5f33d9f12059ad1b28bef8049eb4270a350457
7
- data.tar.gz: 6e2a7f01e43a5932c9fe583a5fcbb4eb9d4e51a59ed0feff51ab6c4a94dfece0463018701bcb669e477891c7b2c6f16f58efb0c89e78570592e14c6a151f196a
6
+ metadata.gz: a6fd5497cc5cc15aa93cc17f247470cb07e4fcd8ce049bf5bc78ddd2e54a349b4f0ffb4714d2ba8938b8a883e2d1ec8e5cb239c78990e194347c477fbef1ed87
7
+ data.tar.gz: e59456de46f9638a5345fc57a7b6fa797dd6ae46b4efa16f2bcb90df52485f688109929332f7773b8115a55ccec280dc4e8fc58e3d04dfebcf15aca385ec685f
data/.ruby-gemset CHANGED
@@ -1 +1 @@
1
- kalibro_gatekeeper_client
1
+ kalibro_client
data/.travis.yml CHANGED
@@ -6,7 +6,7 @@ addons:
6
6
  postgresql: "9.3"
7
7
 
8
8
  before_script:
9
- - git clone https://gist.github.com/6179925.git -b v2.0.rc2 kalibro_install
9
+ - git clone https://gist.github.com/6179925.git -b v2.0 kalibro_install
10
10
  - pushd kalibro_install
11
11
  # Remove bugged libzmq3 package, see https://github.com/travis-ci/travis-ci/issues/982 and https://github.com/travis-ci/travis-ci/issues/1715 for details
12
12
  - sudo apt-get remove libzmq3
@@ -37,11 +37,11 @@ Gem::Specification.new do |spec|
37
37
 
38
38
  spec.add_development_dependency "bundler", "~> 1.3"
39
39
  spec.add_development_dependency "rake"
40
- spec.add_development_dependency "rspec", "~> 3.1.0"
40
+ spec.add_development_dependency "rspec", "~> 3.2.0"
41
41
  spec.add_development_dependency "cucumber", "~> 1.3.14"
42
42
  spec.add_development_dependency "mocha", "~> 1.1.0"
43
43
  spec.add_development_dependency "simplecov"
44
- spec.add_development_dependency "factory_girl", "~> 4.4.0"
44
+ spec.add_development_dependency "factory_girl", "~> 4.5.0"
45
45
  spec.add_development_dependency 'coveralls'
46
46
 
47
47
  spec.add_dependency "activesupport", ">= 2.2.1" #version in which underscore was introduced
@@ -19,9 +19,20 @@ module KalibroClient
19
19
  module Processor
20
20
  class KalibroModule < KalibroClient::Entities::Processor::Base
21
21
 
22
- attr_accessor :name, :granlrty, :id, :long_name, :module_result_id
22
+ attr_accessor :granlrty, :id, :long_name, :module_result_id
23
23
  alias_method :granularity, :granlrty
24
24
 
25
+ def name=(value)
26
+ @long_name = (value.is_a?(Array) ? value.join('.') : value)
27
+ end
28
+
29
+ def name
30
+ @long_name.split('.')
31
+ end
32
+
33
+ def short_name
34
+ name.last
35
+ end
25
36
  end
26
37
  end
27
38
  end
@@ -15,5 +15,5 @@
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
17
  module KalibroClient
18
- VERSION = "0.0.2"
18
+ VERSION = "0.0.3"
19
19
  end
@@ -0,0 +1,51 @@
1
+ # This file is part of KalibroClient
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 'spec_helper'
18
+
19
+ describe KalibroClient::Entities::Processor::KalibroModule do
20
+ subject { FactoryGirl.build(:kalibro_module, long_name: "a.long.name") }
21
+
22
+ describe 'name=' do
23
+ context 'with an array value' do
24
+ it 'is expected to set the long_name to a string of joined elements of the array' do
25
+ value = subject.long_name.split(".")
26
+ subject.name = value
27
+ expect(subject.long_name).to eq("a.long.name")
28
+ end
29
+ end
30
+
31
+ context 'with a string value' do
32
+ it 'is expected to set the long_name to the string passed as argument' do
33
+ value = subject.long_name
34
+ subject.name = value
35
+ expect(subject.long_name).to eq("a.long.name")
36
+ end
37
+ end
38
+ end
39
+
40
+ describe 'name' do
41
+ it 'should return an array of the entire path' do
42
+ expect(subject.name).to eq(subject.long_name.split("."))
43
+ end
44
+ end
45
+
46
+ describe 'short_name' do
47
+ it 'should return the last element of the name array' do
48
+ expect(subject.short_name).to eq(subject.long_name.split(".").last)
49
+ end
50
+ end
51
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kalibro_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego de Araújo Martinez Camarinha
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-02-11 00:00:00.000000000 Z
14
+ date: 2015-02-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -47,14 +47,14 @@ dependencies:
47
47
  requirements:
48
48
  - - "~>"
49
49
  - !ruby/object:Gem::Version
50
- version: 3.1.0
50
+ version: 3.2.0
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
- version: 3.1.0
57
+ version: 3.2.0
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: cucumber
60
60
  requirement: !ruby/object:Gem::Requirement
@@ -103,14 +103,14 @@ dependencies:
103
103
  requirements:
104
104
  - - "~>"
105
105
  - !ruby/object:Gem::Version
106
- version: 4.4.0
106
+ version: 4.5.0
107
107
  type: :development
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - "~>"
112
112
  - !ruby/object:Gem::Version
113
- version: 4.4.0
113
+ version: 4.5.0
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: coveralls
116
116
  requirement: !ruby/object:Gem::Requirement
@@ -301,6 +301,7 @@ files:
301
301
  - spec/entities/miscellaneous/metric_spec.rb
302
302
  - spec/entities/miscellaneous/native_metric_spec.rb
303
303
  - spec/entities/processor/base_spec.rb
304
+ - spec/entities/processor/kalibro_module_spec.rb
304
305
  - spec/entities/processor/metric_collector_details_spec.rb
305
306
  - spec/entities/processor/metric_result_spec.rb
306
307
  - spec/entities/processor/module_result_spec.rb
@@ -448,6 +449,7 @@ test_files:
448
449
  - spec/entities/miscellaneous/metric_spec.rb
449
450
  - spec/entities/miscellaneous/native_metric_spec.rb
450
451
  - spec/entities/processor/base_spec.rb
452
+ - spec/entities/processor/kalibro_module_spec.rb
451
453
  - spec/entities/processor/metric_collector_details_spec.rb
452
454
  - spec/entities/processor/metric_result_spec.rb
453
455
  - spec/entities/processor/module_result_spec.rb