subnet_calc 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/subnet_calc.rb +5 -3
- metadata +2 -2
- metadata.gz.sig +1 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1faa541b180b1e05028a169b0f6caba522666ff7
|
4
|
+
data.tar.gz: 31b09138c648c9ed7223746b3d66872cbaa30f84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: defd091462944103cd5443294504beb6dd9a8c7e82c195c1c477a71fb2db0a41c229d3efe2655969508381557a138edf30e9e6c228bd9458e61bd767916f846a
|
7
|
+
data.tar.gz: ab60d4c82e57372b35e7cc94308557fb26f00fb12adf835b02588b747d307d2e762109026ae3ca974ec948a9e1c7027dca648758caddeb3556dd0db4bcb5cf52
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/subnet_calc.rb
CHANGED
@@ -27,7 +27,7 @@ class SubnetCalc
|
|
27
27
|
def initialize(inputs={})
|
28
28
|
|
29
29
|
@inputs = inputs
|
30
|
-
default_inputs = {hosts: nil, ip:
|
30
|
+
default_inputs = {hosts: nil, ip: nil, prefix: nil}.merge(inputs)
|
31
31
|
|
32
32
|
# Using the input(s) supplied:
|
33
33
|
|
@@ -157,7 +157,9 @@ class SubnetCalc
|
|
157
157
|
class_a_subnets(256 ** 2 / segments, bit.decimal)
|
158
158
|
end
|
159
159
|
|
160
|
-
|
160
|
+
default_inputs[:ip] ||= ['10.0.0.0', '172.16.0.0','192.166.0.0'][class_n-1]
|
161
|
+
|
162
|
+
ip = (default_inputs[:ip] + ' ') .split('.')[0..class_n-1]
|
161
163
|
|
162
164
|
first_ip = (ip + [subnets.first.first]).join('.')
|
163
165
|
last_ip = (ip + [subnets.first.last]).join('.')
|
@@ -216,7 +218,7 @@ Subnet calculator
|
|
216
218
|
|
217
219
|
Inputs:
|
218
220
|
|
219
|
-
#{Kvx.new(@inputs).to_s
|
221
|
+
#{indent Kvx.new(@inputs).to_s}
|
220
222
|
|
221
223
|
Summary
|
222
224
|
-------
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subnet_calc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
oAH9dWawpFIItSVexeVF4ycrINDboVQH/q93Udr9ZLbwux6Dp2bpsAxyXAdIw+Um
|
32
32
|
ZWJvjR10ewlMyQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-11-
|
34
|
+
date: 2016-11-08 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: kvx
|
metadata.gz.sig
CHANGED
@@ -1,5 +1 @@
|
|
1
|
-
���
|
2
|
-
�
|
3
|
-
?̄%�v�*[�l�m9k� &FEw���~#/{8�*M� j�(f�g�.⇟���{E�n�.�b���T�%�E#�I�/�z���ޝf�h�L
|
4
|
-
4���"OO���&���:
|
5
|
-
/W*B[����ջ�����2���2��\��^���B���e6��c��.�̒�����F#�R8��G{���@�?��GC�,
|
1
|
+
�oi(>:�'�\��j���>��&O�<��n0�L��y��vs��t/Ki��u<�#]������I���j\��i�B;�Xg~��,8���?(����<���L��c�%�|MA��Emc�ٜ�>�-���h ���A����P���lsqw �0:SB(C[*F���H=�lHk��LM��I�J����(��@��ݐ���D��P�S��0ަ�F>�i���K
|