pcbr 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pcbr.rb +2 -2
- data/spec/_spec.rb +9 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b3ebecb25ead598113da23a081caff2edae89b2
|
4
|
+
data.tar.gz: 017a54c57edab08278ea631356774a315a0ef976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9935c310af1592e636e9e3c38bc239d7323053eb5c32e3c501ce974ecc17aab10d081892f988c0074b5e579fe8d19350d36d0bcaadceb10dc536a49e293dd58f
|
7
|
+
data.tar.gz: 00ca5fcb6c35b5dec763a96638a25c3b39e548bad1e66f9c8b63905376d1470dc53ae5db0e2537c5a0229b88d30e44eff70bd75fe1624f9c62f32a1e7757439e
|
data/lib/pcbr.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class PCBR
|
2
2
|
|
3
|
-
VERSION = "0.1.
|
3
|
+
VERSION = "0.1.3"
|
4
4
|
|
5
5
|
attr_reader :table
|
6
6
|
|
@@ -21,7 +21,7 @@ class PCBR
|
|
21
21
|
@table.each do |item|
|
22
22
|
array = ARRAY_101.dup
|
23
23
|
calculated.zip(item[3]).each do |a, b|
|
24
|
-
t = a <=> b
|
24
|
+
next unless t = a <=> b
|
25
25
|
array[t] = t
|
26
26
|
end
|
27
27
|
point = array.inject :+
|
data/spec/_spec.rb
CHANGED
@@ -20,6 +20,15 @@ describe "basic specs" do
|
|
20
20
|
expect(rating.size).to eq(2)
|
21
21
|
end
|
22
22
|
|
23
|
+
example "Nil elements in vector are ignored" do
|
24
|
+
rating = PCBR.new
|
25
|
+
rating.store 1, [1, nil]
|
26
|
+
rating.store 2, [2, nil]
|
27
|
+
rating.store 3, [nil, 3]
|
28
|
+
rating.store 4, [nil, 4]
|
29
|
+
expect(rating.sorted).to eq([2, 4, 1, 3])
|
30
|
+
end
|
31
|
+
|
23
32
|
example "&block" do
|
24
33
|
n = 0
|
25
34
|
rating = PCBR.new do |item|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pcbr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Maslov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,9 +72,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|
74
74
|
rubyforge_project:
|
75
|
-
rubygems_version: 2.0.14
|
75
|
+
rubygems_version: 2.0.14.1
|
76
76
|
signing_key:
|
77
77
|
specification_version: 4
|
78
78
|
summary: Pair Comparison Based Rating
|
79
79
|
test_files: []
|
80
|
-
has_rdoc:
|