rgl 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe8f8fb223d89b38255ea2b695204a5fc6f686773c5f127945929d75013ac2bb
4
- data.tar.gz: 8df8df91c990d1c9bf564069681f9ee1176636ff9507f470db5260032af768b1
3
+ metadata.gz: 8f4b3d0c46bc5145d7ff932e0166f220a1d7d8ebbcceead860f442cbfc8e4708
4
+ data.tar.gz: 501fe6687c99a1d4ac7f7801640f2311baa1bda69105f712b8c01e800e0eef44
5
5
  SHA512:
6
- metadata.gz: 7f4caa6a12dc76b702c4f7d0219614d2617861fd331614446731bf2270fa71dd768d2f78d44b1a786c9fb5f9934ec61f1030b77ec16a2922c92f4051b5c9403f
7
- data.tar.gz: 4343592e3a7bd1bbdfd45ab839a16b38f3dec3d336a0febc1f44876c889b058db052e3dff85323a5f4a10a87293e7ca4f9f05d6b5735a23ce75048c418dff3f8
6
+ metadata.gz: c96d01848ccf3e3f285852bd4ae3f492251973d248dcb1b6a1733027b7e7dddb6e5785b84f3e6c3c9c8e6307f808929394a2001ed31f0c01d8f6b14a686cd7dc
7
+ data.tar.gz: 2a44e9de16e9f0b11f03df63ad6ebf17263b5edf38af2cf2d346803895c58e8d496ede3a5a23970ab2db6030f4647a454d6f78a7854bb2dbb5b3194610762ea0
data/lib/rgl/base.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # base.rb
2
2
 
3
3
  # version information
4
- RGL_VERSION = "0.6.0"
4
+ RGL_VERSION = "0.6.1"
5
5
 
6
6
  # Module {RGL} defines the namespace for all modules and classes of the graph
7
7
  # library. The main module is {Graph} which defines the abstract behavior of
@@ -143,7 +143,7 @@ module RGL
143
143
  # method must be defined by concrete graph classes. It defines the BGL
144
144
  # VertexListGraph concept.
145
145
  #
146
- def each_vertex() # :yields: v
146
+ def each_vertex(&block) # :yields: v
147
147
  raise NotImplementedError
148
148
  end
149
149
 
@@ -152,7 +152,7 @@ module RGL
152
152
  # IncidenceGraph concept.
153
153
  # @param v a vertex of the graph
154
154
  #
155
- def each_adjacent(v) # :yields: v
155
+ def each_adjacent(v, &block) # :yields: v
156
156
  raise NotImplementedError
157
157
  end
158
158
 
@@ -52,8 +52,8 @@ module RGL
52
52
  alias :has_out_edge? :has_edge?
53
53
 
54
54
  # @see BidirectionalGraph#each_in_neighbor
55
- def each_in_neighbor(v)
56
- @reverse.each_adjacent(v)
55
+ def each_in_neighbor(v, &b)
56
+ @reverse.each_adjacent(v, &b)
57
57
  end
58
58
 
59
59
  alias :each_out_neighbor :each_adjacent
@@ -153,8 +153,12 @@ class TestBidirectionalAdjacencyGraph < Test::Unit::TestCase
153
153
 
154
154
  def test_each_neighbor
155
155
  @edges.flatten.to_set.each do |v|
156
- assert_equal @out_neighbors[v], @dg.each_out_neighbor(v).inject(Set.new) { |s, v| s << v }
157
- assert_equal @in_neighbors[v], @dg.each_in_neighbor(v).inject(Set.new) { |s, v| s << v }
156
+ out_neighbors = Set.new
157
+ @dg.each_out_neighbor(v) { |n| out_neighbors << n }
158
+ assert_equal @out_neighbors[v], out_neighbors
159
+ in_neighbors = Set.new
160
+ @dg.each_in_neighbor(v) { |n| in_neighbors << n }
161
+ assert_equal @in_neighbors[v], in_neighbors
158
162
  end
159
163
  end
160
164
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Horst Duchene
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire: rgl/base
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-22 00:00:00.000000000 Z
12
+ date: 2023-03-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: stream