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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed194bf35fe325fc2fb62ea861140f63c0f6b5ac
4
- data.tar.gz: 48a9537735c184f33cc7f170364c157e0b7bdcbc
3
+ metadata.gz: 1faa541b180b1e05028a169b0f6caba522666ff7
4
+ data.tar.gz: 31b09138c648c9ed7223746b3d66872cbaa30f84
5
5
  SHA512:
6
- metadata.gz: 37e0e8c28058efe0a2e8a7616e05f778d89faf799a4ad459fc14b442622e9c79a6860c864ba29d561dfa9875ad33f9bfa0c1cdf7d3a5fea09c645bf1597e830a
7
- data.tar.gz: f12f12f39424d089ca56299099327b01c13cab8725dedaa0b4162f2e77913a98c16ac29f384382ece6db222f9a0477b1e603a6b5432ee69f7eb406672518f1fa
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: '192.168.0.0', prefix: nil}.merge(inputs)
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
- ip = (default_inputs[:ip] + ' ') .split('.')[0..octet_n-1]
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.lines.map {|x| ' ' * 2 + x}.join}
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.0
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-07 00:00:00.000000000 Z
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
- ���rM�P��Aj_>�����
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