dgd-tools 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df6b6f5495201cda1059723bc87848c81ef6d112449fd147aed1a6c08873b13f
4
- data.tar.gz: f5adb6e0b687e71002c25fdf694375b06b1c3e400a6a5adaa0f759ae502abea8
3
+ metadata.gz: 838abb7957cb56eb3f096e8e345b3afda6d12db91a6110b7fa07029d589124d5
4
+ data.tar.gz: aa0a2551b3763eb418f99352cb0d40d58bcae92ff50bfce31bff22c644ae7019
5
5
  SHA512:
6
- metadata.gz: 91624cda3d356f2dc5d17e7a003a1ef21bf989c94ef5761e6c265d0fffc08fac932a59dd4e1da9f824e6f9cf79d9746eb9a33bff44a87d7693f9b34476852ecd
7
- data.tar.gz: 2a3efbd628524723b1f7e15982dea8077088fd305a68cfd186a0a0396ac3f321c117e6d1301398b9b80c922524f479a4b6b97c8736b3116d9d7f7793f8fa38b1
6
+ metadata.gz: a661db27d13a97f9086c7802769e1a08ac3f21f7c120f8bea6a6efe6e332a3d2ecb7e2571e0020dd36c8188019af907023662e248c1c1ffadfd9ee3c1b9c5b2a
7
+ data.tar.gz: 15e3742398cb16222e176dc5bc9385445219e23fce1a0cdf9205ced86ad47570c4c422d637734386f6f79e154282c3f57cf02784f9e4238f1ec8208dc4944878
@@ -562,15 +562,18 @@ FILE_CONTENTS
562
562
 
563
563
  def config_to_ports(data)
564
564
  if data.is_a?(Hash)
565
- # TODO: verify that keys are IP addr strings and values are legal port numbers
566
- return data
565
+ return data.map { |ip, port| [ip, Integer(port) ] }
567
566
  elsif data.is_a?(Array)
568
- # TODO: verify that data is an array of legal integer port numbers
569
- ports = {}
570
- data.each { |p| ports["*"] = p }
567
+ if data[0].is_a?(Array)
568
+ ports = data.map { |ip, port| [ip, Integer(port) ] }
569
+ return ports
570
+ end
571
+
572
+ ports = data.map { |p| [ "*", Integer(p) ] }
573
+ STDERR.puts "Arrayified: #{ports.inspect}"
571
574
  return ports
572
575
  elsif data.is_a?(Integer)
573
- return { "*": data }
576
+ return [ [ "*", data ] ]
574
577
  else
575
578
  raise "dgd-manifest: not sure how to get port data from a #{data.class.name} -- #{data.inspect}!"
576
579
  end
@@ -1,3 +1,3 @@
1
1
  module DGD
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dgd-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Gibbs