gratr19 0.4.4 → 0.4.4.1

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.
@@ -267,8 +267,10 @@ module GRATR
267
267
  def +(other)
268
268
  result = self.class.new(self)
269
269
  case other
270
- when GRATR::Graph : result.merge(other)
271
- when GRATR::Arc : result.add_edge!(other)
270
+ when GRATR::Graph
271
+ result.merge(other)
272
+ when GRATR::Arc
273
+ result.add_edge!(other)
272
274
  else result.add_vertex!(other)
273
275
  end
274
276
  end
@@ -276,9 +278,12 @@ module GRATR
276
278
  # Remove all vertices in the specified right hand side graph
277
279
  def -(other)
278
280
  case other
279
- when GRATR::Graph : induced_subgraph(vertices - other.vertices)
280
- when GRATR::Arc : self.class.new(self).remove_edge!(other)
281
- else self.class.new(self).remove_vertex!(other)
281
+ when GRATR::Graph
282
+ induced_subgraph(vertices - other.vertices)
283
+ when GRATR::Arc
284
+ self.class.new(self).remove_edge!(other)
285
+ else
286
+ self.class.new(self).remove_vertex!(other)
282
287
  end
283
288
  end
284
289
 
@@ -81,9 +81,12 @@ module GRATR
81
81
  def cost(u,v=nil,weight=nil)
82
82
  u.kind_of?(Arc) ? weight = v : u = edge_class[u,v]
83
83
  case weight
84
- when Proc : weight.call(u)
85
- when nil : self[u]
86
- else self[u][weight]
84
+ when Proc
85
+ weight.call(u)
86
+ when nil
87
+ self[u]
88
+ else
89
+ self[u][weight]
87
90
  end
88
91
  end
89
92
 
@@ -93,9 +96,12 @@ module GRATR
93
96
  # A function to set properties specified by the user.
94
97
  def property_set(u,name,value)
95
98
  case name
96
- when Proc : name.call(value)
97
- when nil : self[u] = value
98
- else self[u][name] = value
99
+ when Proc
100
+ name.call(value)
101
+ when nil
102
+ self[u] = value
103
+ else
104
+ self[u][name] = value
99
105
  end
100
106
  end
101
107
 
@@ -1,5 +1,5 @@
1
1
  module GRATR
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.4.1"
3
3
 
4
4
  # Deprecated.
5
5
  GRATR_VERSION = VERSION
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gratr19
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 125
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
9
  - 4
10
- version: 0.4.4
10
+ - 1
11
+ version: 0.4.4.1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Shawn Garbett