pcbr 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pcbr.rb +2 -2
  3. data/spec/_spec.rb +9 -0
  4. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b127520de97919ba1fbce82430bef9f29c872dd8
4
- data.tar.gz: 4b33ca2aa2c600ca3fe419815fae79b52bfa20ea
3
+ metadata.gz: 1b3ebecb25ead598113da23a081caff2edae89b2
4
+ data.tar.gz: 017a54c57edab08278ea631356774a315a0ef976
5
5
  SHA512:
6
- metadata.gz: c5e44fb084dad37cfe1c29e4cd9607372dc255f7895731f5bec3e4cbb24574f01dfea035c96b43db2bcac937301597b7b39f16910b98ba85f1e31629a31180cc
7
- data.tar.gz: 5339d942aac5fc793bb6311a0d75001f359dd11b1d6ca4f03f5b28944bbded74c8b57f0704f426decfc0386ebded944ee34424e509d6aeed27f3c89f0007cb6d
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.2"
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.2
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-10-17 00:00:00.000000000 Z
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: