rex-text 0.1.2 → 0.2.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: a213d45ce77b442cf80cc9e8c302d705c9f63128
4
- data.tar.gz: 739aabf270a14239b68f9bdc3f394eebaa949efc
3
+ metadata.gz: fac6885e671b050ccbdf774302465ff811fbc570
4
+ data.tar.gz: 5c2e95fcbe12e42aeb4d6bc992fdc76c942e157a
5
5
  SHA512:
6
- metadata.gz: cd856ab7b00383f19e189e4da9f55e8b078a6ef1429535b4e6c223ce853dd83bbdd8fb562cb0f7fe295db52de89c538e11fa1b677f0d97a15684271de22671d7
7
- data.tar.gz: e77455056b8e1ffa80af71886deae1576a21b8f92bc2450f296dc4430ec6cd5c9a229d03c95fc3cc6cb788aeef5aa9e829103d88116d751bc6046c20b5e1dd33
6
+ metadata.gz: c0a5db90d2bf08b2764ea395e356183d9f0cf841ad21362564d7d53c00bed7843798f056cc662ca3810d6f54ffdd1870caab2505988a16e7cb932effbc4704e2
7
+ data.tar.gz: a404a8c91eafda2db0b59ad20e3cce8fd281225af988ab460ea046dc189eb065669d043fdf12fcfd48fee34bb1188bb645f9239fe99846fee99b33fc35e07174
checksums.yaml.gz.sig CHANGED
@@ -1 +1 @@
1
- Gg�� K��9UL^S��TY<�Xp?n�n�Ҫ�\�t����:���&Y_�' A�nf) ��E6HSYh��zV=�Д�b��"V������� 5�W�ɦr��;;���^ T�����7L��i�?Db��Qs�fZ
1
+ oK���aA�+���a6:�JGuh;�/�6��v3r�}gMJ'����9)s��o*QzlyHA��)�"z8cZZuP
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- ZC.���^�m��PyH'k��#��%��e��)o,�+�����F��3e)kl �,
2
- ���|a�����X�t�E�˅�@R�S��z���%Zk]z5����܊��b���KE
1
+ FKĆ���.Q�����0�����D �e)yl1�<�l�`X� ���"�e��t�t7
2
+ ��-XFL{���
@@ -1,4 +1,5 @@
1
1
  # -*- coding: binary -*-
2
+ require 'ipaddr'
2
3
 
3
4
  module Rex
4
5
  module Text
@@ -196,14 +197,14 @@ class Table
196
197
  cmp = -1
197
198
  elsif b[index].nil?
198
199
  cmp = 1
199
- elsif valid_ip?(a[index]) and valid_ip?(b[index])
200
- cmp = IPAddr.new(a[index]) <=> IPAddr.new(b[index])
201
200
  elsif a[index] =~ /^[0-9]+$/ and b[index] =~ /^[0-9]+$/
202
201
  cmp = a[index].to_i <=> b[index].to_i
203
202
  elsif a[index].kind_of?(IPAddr) && a[index].kind_of?(IPAddr) && a[index].ipv6? && b[index].ipv4?
204
203
  cmp = 1
205
204
  elsif a[index].kind_of?(IPAddr) && b[index].kind_of?(IPAddr) && a[index].ipv4? && b[index].ipv6?
206
205
  cmp = -1
206
+ elsif !(a[index].kind_of?(IPAddr) || b[index].kind_of?(IPAddr)) && (valid_ip?(a[index]) && valid_ip?(b[index]))
207
+ cmp = IPAddr.new(a[index]) <=> IPAddr.new(b[index])
207
208
  else
208
209
  cmp = a[index] <=> b[index] # assumes otherwise comparable.
209
210
  end
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Text
3
- VERSION = "0.1.2"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rex-text
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David 'thelightcosine' Maloney
@@ -85,7 +85,7 @@ cert_chain:
85
85
  2SpuQH+SWteq3NXkAmFEEqvLJQ4sbptZt8OP8ghL3pVAvZNFmww/YVszSkShSzcg
86
86
  QdihYCSEL2drS2cFd50jBeq71sxUtxbv82DUa2b+
87
87
  -----END CERTIFICATE-----
88
- date: 2016-08-10 00:00:00.000000000 Z
88
+ date: 2016-08-11 00:00:00.000000000 Z
89
89
  dependencies:
90
90
  - !ruby/object:Gem::Dependency
91
91
  name: bundler
metadata.gz.sig CHANGED
Binary file