lib/zold/remotes.rb
# The default TCP port all nodes are supposed to use.
The default TCP port all nodes are supposed to use.
The default TCP port all nodes are supposed to use .
def load
      @mutex.synchronize do
        raw = CSV.read(file).map do |r|
          {
            host: r[0],
            port: r[1].to_i,
            score: r[2].to_i,
            errors: r[3].to_i
          }
        end
        raw.reject { |r| !r[:host] || r[:port].zero? }.map do |r|
          r[:home] = URI("http://#{r[:host]}:#{r[:port]}/")
          r
        end
      end
    end
def load @mutex . synchronize do raw = CSV . read ( file ) . map do | r | { host : r [ 0 ] , port : r [ 1 ] . to_i , score : r [ 2 ] . to_i , errors : r [ 3 ] . to_i } end raw . reject { | r | ! r [ :host ] || r [ :port ] . zero? } . map do | r | r [ :home ] = URI ( "http://#{r[:host]}:#{r[:port]}/" ) r end end end
The default TCP port all nodes are supposed to use.
The default TCP port all nodes are supposed to use .