ruby-nuggets 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +2 -2
- data/lib/nuggets/util/dotted_decimal.rb +13 -1
- data/lib/nuggets/version.rb +1 -1
- metadata +2 -2
data/README
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
== VERSION
|
4
4
|
|
5
|
-
This documentation refers to ruby-nuggets version 0.5.
|
5
|
+
This documentation refers to ruby-nuggets version 0.5.1
|
6
6
|
|
7
7
|
|
8
8
|
== DESCRIPTION
|
@@ -47,7 +47,7 @@ Rubyforge project:: <http://rubyforge.org/projects/prometheus>
|
|
47
47
|
|
48
48
|
== LICENSE AND COPYRIGHT
|
49
49
|
|
50
|
-
Copyright (C) 2007-
|
50
|
+
Copyright (C) 2007-2009 Jens Wille
|
51
51
|
|
52
52
|
ruby-nuggets is free software: you can redistribute it and/or modify it under
|
53
53
|
the terms of the GNU General Public License as published by the Free Software
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# A component of ruby-nuggets, some extensions to the Ruby programming #
|
5
5
|
# language. #
|
6
6
|
# #
|
7
|
-
# Copyright (C) 2007-
|
7
|
+
# Copyright (C) 2007-2009 Jens Wille #
|
8
8
|
# #
|
9
9
|
# Authors: #
|
10
10
|
# Jens Wille <jens.wille@uni-koeln.de> #
|
@@ -51,6 +51,14 @@ class String
|
|
51
51
|
|
52
52
|
end
|
53
53
|
|
54
|
+
class Array
|
55
|
+
|
56
|
+
def sort_by_dotted_decimal
|
57
|
+
sort_by { |i| i.split('.').map { |j| j.to_i } }
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
54
62
|
if $0 == __FILE__
|
55
63
|
[2294967042, 4294967040].each { |i|
|
56
64
|
p i.to_binary_s(32)
|
@@ -63,4 +71,8 @@ if $0 == __FILE__
|
|
63
71
|
p s
|
64
72
|
p s.from_dotted_decimal.to_binary_s(32)
|
65
73
|
}
|
74
|
+
|
75
|
+
a = %w[77.47.161.3 196.101.53.1 77.47.161.11]
|
76
|
+
p a.sort
|
77
|
+
p a.sort_by_dotted_decimal
|
66
78
|
end
|
data/lib/nuggets/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-nuggets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Wille
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-03-03 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|