dyntool 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/dyntool.rb +10 -0
  2. metadata +3 -3
data/lib/dyntool.rb CHANGED
@@ -642,6 +642,16 @@ class OperateDyn
642
642
  @labels << "#{@label}"
643
643
  @weights << "#{@weight}"
644
644
  end
645
+ @wtc = 0
646
+ @weights.uniq.each do |wt|
647
+ @wtc += 1
648
+ end
649
+ if @wtc != 1
650
+ @ips_len = (@ips_len / 3).floor
651
+ end
652
+ if @ips_len > 13
653
+ @ips_len = 13
654
+ end
645
655
  @ttl = @@conf.GetIpTTL(region)
646
656
  @labels = @labels.uniq
647
657
  @region_hash[@i] = { :name => "#{region}", :label => { :a_label => @labels}, :weight => { :a_weight => @weights }, :serve_count => { :a_serve_count => @ips_len }, :ttl => { :a_ttl => "#{@ttl}" }, :countries => @countries, :rdata => @ips_hash }
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 6
9
- version: 0.1.6
8
+ - 7
9
+ version: 0.1.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ariel Moskovich
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2013-09-29 00:00:00 +03:00
17
+ date: 2013-12-24 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20