summaryrefslogtreecommitdiff
path: root/lib/ipaddr.rb
AgeCommit message (Collapse)Author
2018-12-18Import ipaddr 1.2.2knu
- Enable frozen_string_literal and do a bit of code cleanup git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-09Include the input in the message when raising InvalidAddressErrorknu
[Feature #5987] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Use caller with length to reduce unused stringskazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Import ipaddr 1.2.0knu
- Add IPAddr#prefix - Add IPAddr#loopback? - Add IPAddr#private? [Feature #11666] - Add IPAddr#link_local? [Feature #10912] - Reject invalid address mask [Bug #13399] - Warn that IPAddr#ipv4_compat and #ipv4_compat? are deprecated [#Bug 13769] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05IPAddr#== and IPAddr#<=> no longer raise an exception if coercion failsknu
* lib/ipaddr.rb (IPAddr#==): If coercion fails, return false instead of passing through the exception. [ruby-core:77451] [Bug #12799] * lib/ipaddr.rb (IPAddr#<=>): If coercion fails, return nil instead of passing through the exception. [ruby-core:77451] [Bug #12799] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21ipaddr: fix typo [ci skip]nobu
* lib/ipaddr.rb: [DOC] fix documentation of IN6MASK to mention IPv6. [Fix GH-1349] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23* lib/ipaddr.rb, test/test_ipaddr.rb: Reject invalid address containedhsbt
EOL string. Patch by @kachick [fix GH-942][Bug #11513] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-31* lib/ipaddr.rb: extracted inline tests into test dir.hsbt
* test/test_ipaddr.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-18* lib/ipaddr.rb (IPAddr#in6_addr): Fix a typo with the closingknu
parenthesis. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-18Fix the IPv6 parser.knu
* lib/ipaddr.rb (IPAddr#in6_addr): Fix the parser so that it can recognize IPv6 addresses with only one edge 16-bit piece compressed, like [::2:3:4:5:6:7:8] or [1:2:3:4:5:6:7::]. [Bug #7477] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-16* lib/cgi/core.rb: Use symbols instead of strings formarcandre
{const_,instance_variable_}{get,set}. [#7161] * lib/drb/drb.rb: ditto. * lib/ipaddr.rb: ditto. * lib/irb/workspace.rb: ditto. * lib/monitor.rb: ditto. * lib/rss/maker/base.rb: ditto. * lib/rss/rss.rb: ditto. * lib/xmlrpc/parser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-31* lib/ipaddr.rb: Introduce several new error classes where onlyknu
ArgumentError and StandardError were used. IPAddr::Error is their common ancestor class that inherits from ArgumentError for backward compatibility. Submitted by Jon Daniel. Fixes #173 on GitHub. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-21remove trainling spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-02* lib/ipaddr.rb: Inhibit zero-filled octets in an IPv4 address inknu
all platforms. [ruby-dev:45671] * lib/ipaddr.rb: Allow the x:x:x:x:x:x:d.d.d.d form not limited to IPv4 mapped/compatible addresses. This change also makes it possible for the parser to understand IPv4 mapped and compatible IPv6 addresses in non-compressed form. * lib/ipaddr.rb: Stop exposing IPSocket.valid*? methods which were only usable on non-IPv6-ready platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 * lib/ipaddr.rb: Improve documentation. Patch by Sandor Szucs.drbrain
[Ruby 1.9 - Bug #4753] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-19* lib: revert r31635-r31638 and untabify with expand(1).nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18 * lib: Convert tabs to spaces for ruby files perdrbrain
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style Patch by Steve Klabnik [Ruby 1.9 - Bug #4730] Patch by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-13 * lib/ipaddr.rb (unless Socket): Document valid*? methods. Patch bydrbrain
Sebastian Martinez. [Ruby 1.9 - Feature #4687] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-21* lib/resolv-replace.rb: specify super class for rdoc.akr
* lib/ipaddr.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-20* lib: fixed typo. a patch by Sho Hashimoto in [ruby-dev:40716].nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05* lib/ipaddr.rb (IPAddr#hash): Take account of netmask; submittedknu
by Nobuhiro IMAI in [ruby-dev:39011] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-04* lib/ipaddr.rb (IPAddr#{eql?,hash}): Add IPAddr#{eql?,hash} soknu
that an IPAddr object can be used as a hash key, a set element, etc.; suggested by Nick Brown <nick@nick-brown.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06* {ext,lib,test}/**/*.rb: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23Added changes needed for miniunit. usually from using internal calls that ↵ryan
aren't needed anymore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-07* lib/ipaddr.rb (IPAddr#initialize): get rid of ArgumentError innobu
IPAddr#to_range. a patch from okkez <okkez000 AT gmail.com> in [ruby-dev:35091]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-21* lib/ipaddr.rb: Say that I am the current maintainer.knu
* lib/set.rb: Ditto. * lib/shellwords.rb: Ditto. * ext/syslog/syslog.txt: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-04* lib/ipaddr.rb (in_addr, in6_addr, addr_mask): Make some minorknu
code optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-04* lib/ipaddr.rb (<=>): Implement IPAddr#<=> and make IPAddrknu
comparable. * lib/ipaddr.rb (succ): Implement IPAddr#succ. You can now create a range between two IPAddr's, which (Range) object is enumeratable. * lib/ipaddr.rb (to_range): A new method to create a Range object for the (network) address. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-04* lib/ipaddr.rb (coerce_other): Support type coercion and make &,knu
|, == and include? accept a string or an integer instead of an IPAddr object as the argument. * lib/ipaddr.rb (initialize): Give better error messages. * lib/ipaddr.rb: Improve documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-04Move Example so RDoc picks it up.drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-04Documentation cleanup.drbrain
Includes patches by Hugh Sasse: * ping.rb * weakref.rb * mailread.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-20* object.c (rb_mod_attr): make Module#attr to be an alias tomatz
attr_reader. [RCR#331] * ruby.h: export classes/modules to implement sandbox. [ruby-core:08283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-19* lib/ipaddr.rb (test_s_new): typo.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-19* lib/ipaddr.rb (to_s, test_to_s): too many colons with some cases.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-18lib/ipaddr.rb (initialize): rescue StandardError.eban
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-18* lib/ipaddr.rb (IPSocket::getaddress): merge usa's patch.eban
[ruby-dev:21678] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-14* ext/socket/socket.c (Init_socket): IPv6 is not supported althougheban
AF_INET6 is defined on MinGW. * lib/ipaddr.rb (AF_INET6): workaround in the environment which does not support IPv6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-04-24* lib/ipaddr.rb (include?): Support non-IPAddr parameters by Dave Thomas. ↵nobu
[ruby-core:00980] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-23* MANIFEST, lib/README, lib/ipaddr.rb: Add ipaddr.rb from rough.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e