rbbt-util 5.5.40 → 5.5.41
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 +8 -8
- data/lib/rbbt/association/item.rb +2 -2
- data/lib/rbbt/persist.rb +2 -2
- data/test/rbbt/association/test_item.rb +15 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2Q5NzcyNjhmNWI0ZGYxMmFhNmJhYTZmZDRlMWY3NTBhYjAzMzNhNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2UwYWE1OTNmOTFiYjZhOTE3MjE0MjE0ODkxNGUzMmJlMzVkYWJiNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2Q4NzBkOTllY2ViMzVkYjA3M2Q3ODc4NDQ2MzM5YzM2YzM3N2YzNGNiN2I0
|
10
|
+
NDViYTdiMDI1NmM5NzdmNTg5NWU3OWQ2YmI5ZTc1Nzk3MWU3YWM1ZGMxNzBi
|
11
|
+
OTdhZTc1MTE1MTk3MTk3ZWMzZGQzYzJiZWU3Y2M1OTUwNTViMWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWQ3NmRiYTNjNmRjMDM5NGQxOTQzNzY4Y2Y5MmYxZTVlODhiOWYzZDg5NGY1
|
14
|
+
NDcyMGI3NGNjNGE1OWY0NDY1ZWY2Nzk2MzUwMjRlODRiMDNjNDYyYmVmN2Jl
|
15
|
+
ODZjMjBhZTQ0NzZhOWU5OTQzOWJmMGVhNjJjN2UzMmNjNGU3Y2M=
|
@@ -43,7 +43,7 @@ module AssociationItem
|
|
43
43
|
}
|
44
44
|
end
|
45
45
|
|
46
|
-
def self.incidence(pairs)
|
46
|
+
def self.incidence(pairs, key_field = nil)
|
47
47
|
matrix = {}
|
48
48
|
targets = []
|
49
49
|
sources = []
|
@@ -64,6 +64,6 @@ module AssociationItem
|
|
64
64
|
matrix[s] = hash.values_at(*targets)
|
65
65
|
end
|
66
66
|
|
67
|
-
defined?(TSV)? TSV.setup(matrix, :fields => targets, :type => :list) : matrix
|
67
|
+
defined?(TSV)? TSV.setup(matrix, :key_field => (key_field || "Source") , :fields => targets, :type => :list) : matrix
|
68
68
|
end
|
69
69
|
end
|
data/lib/rbbt/persist.rb
CHANGED
@@ -259,7 +259,7 @@ module Persist
|
|
259
259
|
else
|
260
260
|
|
261
261
|
if is_persisted?(path, persist_options)
|
262
|
-
Log.low "Persist up-to-date: #{ path } - #{persist_options
|
262
|
+
Log.low "Persist up-to-date: #{ path } - #{Misc.fingerprint persist_options}"
|
263
263
|
return nil if persist_options[:no_load]
|
264
264
|
return load_file(path, type)
|
265
265
|
end
|
@@ -268,7 +268,7 @@ module Persist
|
|
268
268
|
lock_filename = Persist.persistence_path(path + '.persist', {:dir => Persist.lock_dir})
|
269
269
|
Misc.lock lock_filename do
|
270
270
|
if is_persisted?(path, persist_options)
|
271
|
-
Log.low "Persist up-to-date: #{ path } - #{persist_options
|
271
|
+
Log.low "Persist up-to-date (suddenly): #{ path } - #{Misc.fingerprint persist_options}"
|
272
272
|
return nil if persist_options[:no_load]
|
273
273
|
return load_file(path, type)
|
274
274
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../../..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'test/unit'
|
4
|
+
require 'rbbt/tsv'
|
5
|
+
require 'rbbt/association/item'
|
6
|
+
|
7
|
+
class TestAssociationItem < Test::Unit::TestCase
|
8
|
+
def test_incidence
|
9
|
+
pairs = [[:A, :a], [:B, :b]].collect{|p| "#{p.first.to_s}~#{p.last.to_s}"}
|
10
|
+
assert TSV === AssociationItem.incidence(pairs)
|
11
|
+
assert_equal 2, AssociationItem.incidence(pairs).length
|
12
|
+
assert_equal 2, AssociationItem.incidence(pairs).fields.length
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.5.
|
4
|
+
version: 5.5.41
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -198,6 +198,7 @@ files:
|
|
198
198
|
- share/rbbt_commands/workflow/server
|
199
199
|
- share/rbbt_commands/workflow/task
|
200
200
|
- test/rbbt/association/test_index.rb
|
201
|
+
- test/rbbt/association/test_item.rb
|
201
202
|
- test/rbbt/resource/test_path.rb
|
202
203
|
- test/rbbt/test_annotations.rb
|
203
204
|
- test/rbbt/test_association.rb
|
@@ -265,6 +266,7 @@ test_files:
|
|
265
266
|
- test/rbbt/tsv/test_change_id.rb
|
266
267
|
- test/rbbt/test_fix_width_table.rb
|
267
268
|
- test/rbbt/association/test_index.rb
|
269
|
+
- test/rbbt/association/test_item.rb
|
268
270
|
- test/rbbt/test_association.rb
|
269
271
|
- test/rbbt/test_workflow.rb
|
270
272
|
- test/rbbt/workflow/test_step.rb
|