graphos 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphos/version.rb +1 -1
- data/lib/graphos/weighted/text_factory.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 954f1ab14ea2478a159df3d397088aade9bad337
|
4
|
+
data.tar.gz: 05b945a9d9aa5de90260897a2cf7aac2d3949a67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a11b436bc5e501b84cfaeca18ff38f3accabfc37779006f749d94bd22c1f5c9d94d2cc803eddbbb51ca938d6fcc16f968ebd2b47e9799f6399cd87c94ddde0b9
|
7
|
+
data.tar.gz: 539c8289d370dace0d336948e227cd26cd345361ca4987d189882c9c2a291964082bde2cdc98f09d47615a4371a45b88c27d4cc864877412076e76f904f314ff
|
data/lib/graphos/version.rb
CHANGED
@@ -2,9 +2,9 @@ module Graphos
|
|
2
2
|
module Weighted
|
3
3
|
module TextFactory
|
4
4
|
def self.read path
|
5
|
-
|
6
|
-
graph = Graph.new(
|
7
|
-
|
5
|
+
lines = IO.readlines(path)
|
6
|
+
graph = Graph.new(lines[0].to_i)
|
7
|
+
lines[1..-1].each do |line|
|
8
8
|
args = line.split(/[ \n]+/)
|
9
9
|
graph.add_edge args[0].to_i-1, args[1].to_i-1, args[2].to_f
|
10
10
|
end
|