graphos 0.3.4 → 0.3.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ba60b53a39cf6c34299ed5a55f7372618c1a4c2
4
- data.tar.gz: 89cb915d41ae66525516851b699187cff654caa5
3
+ metadata.gz: 954f1ab14ea2478a159df3d397088aade9bad337
4
+ data.tar.gz: 05b945a9d9aa5de90260897a2cf7aac2d3949a67
5
5
  SHA512:
6
- metadata.gz: f1ba13a86d3c753a036db4fcbf844ade4959b28a5c12cbc1a2ddb568990adf2f04a51b21db188e147979e695145f8d0fa5880e80b203a2b48dcb7d0f7e578a73
7
- data.tar.gz: 50f395bccfe7da8e2cb0d41b4fba2ff05ff11967228fc65109a8f1e240d922763589e951cc74cc18f7f8facd78e40c4215610344a0836d6423ec74179a28f1f1
6
+ metadata.gz: a11b436bc5e501b84cfaeca18ff38f3accabfc37779006f749d94bd22c1f5c9d94d2cc803eddbbb51ca938d6fcc16f968ebd2b47e9799f6399cd87c94ddde0b9
7
+ data.tar.gz: 539c8289d370dace0d336948e227cd26cd345361ca4987d189882c9c2a291964082bde2cdc98f09d47615a4371a45b88c27d4cc864877412076e76f904f314ff
@@ -1,3 +1,3 @@
1
1
  module Graphos
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
@@ -2,9 +2,9 @@ module Graphos
2
2
  module Weighted
3
3
  module TextFactory
4
4
  def self.read path
5
- f = File.open(path,"r")
6
- graph = Graph.new(f.gets.to_i)
7
- while(line=f.gets)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernardo Amorim