holman_active_directory 2.0.0 → 2.1.0

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: 0c0cbeffe1cb8df305951839cf5d945e42e95ed0
4
- data.tar.gz: dbb87eceef4d58b9e6adbaaaf8ca73a15aa351f5
3
+ metadata.gz: 002512b9dd78c1a106bfcd278370d33c80653af5
4
+ data.tar.gz: 2c530b7942b63c8312e8935c85a989e6ab7214c0
5
5
  SHA512:
6
- metadata.gz: aa3657e63e23e1b218a396e358832ada4f1c29e8aad46c3cf73baf3676fea5109ff39562171764f9085744cd0b40f756f3de4198b1e07fa48202d82481b691b3
7
- data.tar.gz: da4546810688f0f074691ee213c2ccfe140fb560b806d022e227fdf9bf32d2db2b47c3d626e4b04365042a8376e28b320a2c3cd1e8f0631c9d228c9fd9bfdb37
6
+ metadata.gz: da2821ee6a5eb0c17bc92ab73cec7aa7d58a41d0552e7a7a34b70d12268aae8151b0971a31ae1b22b54ed26888ec476c8ee1bdb949ea214c9343108e4ba1497b
7
+ data.tar.gz: 233e5b97c49f30c30cbf6653a5e6d0aaf6d3d6e002a5e1094c9418e020a43f335cd263cc083a022bd1dfc970a7a8011ea54da47ad1b60f1043f4fdd18dbbec1f
@@ -70,7 +70,7 @@ module HolmanActiveDirectory
70
70
  @server_configs || {}
71
71
  end
72
72
 
73
- def set_fastest_hosts
73
+ def set_fastest_hosts(ping_count=5)
74
74
  require 'net/ping/tcp'
75
75
 
76
76
  domain = Struct.new(:directory, :addresses) do
@@ -89,8 +89,8 @@ module HolmanActiveDirectory
89
89
 
90
90
  domains.each do |d|
91
91
  d.addresses.each do |a|
92
- pings = 5.times.map { Net::Ping::TCP.new(a.ip, 'ldap', 0.05).ping || 60 }
93
- a.avg = pings.sum / 5
92
+ pings = ping_count.times.map { Net::Ping::TCP.new(a.ip, 'ldap', 0.05).ping || 60 }
93
+ a.avg = pings.inject(0, &:+) / ping_count
94
94
  end
95
95
  end
96
96
 
@@ -1,3 +1,3 @@
1
1
  module HolmanActiveDirectory
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: holman_active_directory
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Cavileer