From bea4380c30668c9ea0649c5eb2ef2c0ad61096ee Mon Sep 17 00:00:00 2001 From: bluemonk Date: Sun, 18 Jul 2010 14:55:04 +0200 Subject: Fixed some documentation and formatted CHANGELOG with rdoc --- CHANGELOG | 75 ---------------------------------------------------------- CHANGELOG.rdoc | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.rdoc | 17 +++++++------ 3 files changed, 83 insertions(+), 82 deletions(-) delete mode 100644 CHANGELOG create mode 100644 CHANGELOG.rdoc diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100644 index a2eeecf..0000000 --- a/CHANGELOG +++ /dev/null @@ -1,75 +0,0 @@ - -ipaddress 0.6.0 ---------------- - -API changes -* IPv4#to_s now returns the address portion only, - to retain compatibility with IPAddr. Example: - - IPAddress("172.16.10.1/24").to_s - #=> "172.16.10.1" # ipaddress 0.6.0 - - IPAddress("172.16.10.1/24").to_s - #=> "172.16.10.1/24" # ipaddress 0.5.0 - -* IPv6#to_s now returns the address portion only, - to retain compatibility with IPAddr. Example: - - IPAddress "2001:db8::8:800:200c:417a/64".to_s - #=> "2001:db8::8:800:200c:417a" # ipaddress 0.6.0 - - IPAddress "2001:db8::8:800:200c:417a/64".to_s - #=> "2001:db8::8:800:200c:417a/64" # ipaddress 0.6.0 - -* IPv6::Unspecified#to_s, IPv6::Loopback and - IPv6::Mapped#to_s now return the address portion only, - to retain compatibility with IPAddr. - -* IPv4::summarize now returns an array even if the - result is a single subnet, to keep consistency - and avoid confusion - -New methods -* IPv4#to_string and IPv6#to_string: print the address - with the prefix portion, like the #to_s method in - ipaddress 0.5.0 -* IPAddress::parse, for those who don't like the wrapper - method IPAddress() -* IPv6#to_string_uncompressed, returns a string with the - uncompressed IPv6 and the prefix -* IPv6::Mapped#to_string, returns the IPv6 Mapped address - with IPv4 notation and the prefix -* IPv6#reverse, returns the ip6.arpa DNS reverse lookup - string -* IPv4#arpa and IPv6#arpa, alias of the respective #reverse - methods -* Prefix#+, Prefix#- - -Library structure -* Moved all the IPAddress module methods from - lib/ipaddress/ipbase.rb to lib/ipaddress.rb -* Removed IPBase superclass -* IPv4 and IPv6 classes no longer inherit from IPBase -* Removed lib/ipaddress/ipbase.rb -* Removed test/ipaddress/ipbase_test.rb - -Minor fixes -* Replaced Ruby 1.9 deprecated Hash#index with Hash#key -* Removed require ruby-prof from tests which was causing - users to install ruby-prof or manually remove the line -* Removed "must" method from tests, replaced by normal - Test::Unit methods -* Removed duplicate Jeweler entry in Rakefile -* Made Integer#closest_power_of_2 more general by adding - an optional limit parameter -* Fixed summarization algorithm (thanks to nicolas fevrier) -* Fixed bug in prefix_from_ip (thanks to jdpace) - -Documentation -* Normalized README rdoc headers -* Added documentation for IPAddress::Prefix -* Added documentation for IPAddress::IPv4 and - IPAddress::IPv6 -* Fixed formatting -* Fixed lots of typos - diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc new file mode 100644 index 0000000..65d800a --- /dev/null +++ b/CHANGELOG.rdoc @@ -0,0 +1,73 @@ + +== ipaddress 0.6.0 + +=== API changes +* IPv4#to_s now returns the address portion only, + to retain compatibility with IPAddr. Example: + + IPAddress("172.16.10.1/24").to_s + #=> "172.16.10.1" # ipaddress 0.6.0 + + IPAddress("172.16.10.1/24").to_s + #=> "172.16.10.1/24" # ipaddress 0.5.0 + +* IPv6#to_s now returns the address portion only, + to retain compatibility with IPAddr. Example: + + IPAddress "2001:db8::8:800:200c:417a/64".to_s + #=> "2001:db8::8:800:200c:417a" # ipaddress 0.6.0 + + IPAddress "2001:db8::8:800:200c:417a/64".to_s + #=> "2001:db8::8:800:200c:417a/64" # ipaddress 0.6.0 + +* IPv6::Unspecified#to_s, IPv6::Loopback and + IPv6::Mapped#to_s now return the address portion only, + to retain compatibility with IPAddr. +* IPv4::summarize now returns an array even if the + result is a single subnet, to keep consistency + and avoid confusion + +=== New methods +* IPv4#to_string and IPv6#to_string: print the address + with the prefix portion, like the #to_s method in + ipaddress 0.5.0 +* IPAddress::parse, for those who don't like the wrapper + method IPAddress() +* IPv6#to_string_uncompressed, returns a string with the + uncompressed IPv6 and the prefix +* IPv6::Mapped#to_string, returns the IPv6 Mapped address + with IPv4 notation and the prefix +* IPv6#reverse, returns the ip6.arpa DNS reverse lookup + string +* IPv4#arpa and IPv6#arpa, alias of the respective #reverse + methods +* Prefix#+, Prefix#- + +=== Library structure +* Moved all the IPAddress module methods from + lib/ipaddress/ipbase.rb to lib/ipaddress.rb +* Removed IPBase superclass +* IPv4 and IPv6 classes no longer inherit from IPBase +* Removed lib/ipaddress/ipbase.rb +* Removed test/ipaddress/ipbase_test.rb + +=== Minor fixes +* Replaced Ruby 1.9 deprecated Hash#index with Hash#key +* Removed require ruby-prof from tests which was causing + users to install ruby-prof or manually remove the line +* Removed "must" method from tests, replaced by normal + Test::Unit methods +* Removed duplicate Jeweler entry in Rakefile +* Made Integer#closest_power_of_2 more general by adding + an optional limit parameter +* Fixed summarization algorithm (thanks to nicolas fevrier) +* Fixed bug in prefix_from_ip (thanks to jdpace) + +=== Documentation +* Normalized README rdoc headers +* Added documentation for IPAddress::Prefix +* Added documentation for IPAddress::IPv4 and + IPAddress::IPv6 +* Fixed formatting +* Fixed lots of typos + diff --git a/README.rdoc b/README.rdoc index 99f6647..cd804d6 100644 --- a/README.rdoc +++ b/README.rdoc @@ -34,6 +34,9 @@ Some quick examples of things you can't do with IPAddr: * iterate over hosts * perform subnetting or network aggregation +Moreover, many methods and procedures are so old that they have been +declared deprecated by the IETF. + We hope that IPAddress will address all these issues and meet all your needs in network programming. @@ -257,7 +260,7 @@ address: #=> # - bcast.to_s + bcast.to_string #=> "172.16.10.255/24" ===== Addresses, ranges and iterators @@ -442,7 +445,7 @@ instance the following two networks: These two networks can be expressed using only one IP address network if we change the prefix. Let Ruby do the work: - IPAddress::IPv4::summarize(ip1,ip2).to_s + IPAddress::IPv4::summarize(ip1,ip2).to_string #=> "172.16.10.0/23" We note how the network "172.16.10.0/23" includes all the @@ -500,13 +503,13 @@ example, given the network you can supernet it with a new /23 prefix - ip.supernet(23).to_s + ip.supernet(23).to_string #=> "172.16.10.0/23" However if you supernet it with a /22 prefix, the network address will change: - ip.supernet(22).to_s + ip.supernet(22).to_string #=> "172.16.8.0/22" This is because "172.16.10.0/22" is not a network anymore, but an host @@ -638,8 +641,8 @@ or to hexadecimal representation ip6.to_hex #=> "20010db80000000000080800200c417a" -To print out an IPv6 address in human readable form, use the IPv6#to_s -and IPv6#to_string methods +To print out an IPv6 address in human readable form, use the IPv6#to_s, IPv6#to_string +and IPv6#to_string_uncompressed methods ip6 = IPAddress "2001:db8::8:800:200c:417a/64" @@ -744,7 +747,7 @@ subclass: ip = IPAddress::IPv6::Unspecified.new ip.to_string - #=> => "::/128" + #=> "::/128" You can easily check if an IPv6 object is an unspecified address by using the IPv6#unspecified? method -- cgit v1.2.1