aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ipaddr.rb
Commit message (Collapse)AuthorAgeFilesLines
* Import ipaddr 1.2.2knu2018-12-181-4/+4
| | | | | | | - 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
* Include the input in the message when raising InvalidAddressErrorknu2018-08-091-0/+2
| | | | | | [Feature #5987] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add uplevel keyword to Kernel#warn and use itshyouhei2017-12-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use caller with length to reduce unused stringskazu2017-10-211-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Import ipaddr 1.2.0knu2017-10-211-2/+88
| | | | | | | | | | | - 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
* IPAddr#== and IPAddr#<=> no longer raise an exception if coercion failsknu2016-11-051-5/+8
| | | | | | | | | | | | * 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
* ipaddr: fix typo [ci skip]nobu2016-05-211-1/+1
| | | | | | | * 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
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | 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
* * lib/ipaddr.rb, test/test_ipaddr.rb: Reject invalid address containedhsbt2015-10-231-2/+2
| | | | | | 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
* * lib/ipaddr.rb: extracted inline tests into test dir.hsbt2014-05-311-277/+0
| | | | | | * test/test_ipaddr.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ipaddr.rb (IPAddr#in6_addr): Fix a typo with the closingknu2013-02-181-1/+1
| | | | | | | | | parenthesis. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix the IPv6 parser.knu2013-02-181-1/+6
| | | | | | | | | | | * 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
* * lib/cgi/core.rb: Use symbols instead of strings formarcandre2012-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | {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
* * lib/ipaddr.rb: Introduce several new error classes where onlyknu2012-08-311-42/+53
| | | | | | | | | 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
* remove trainling spaces.nobu2012-08-211-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ipaddr.rb: Inhibit zero-filled octets in an IPv4 address inknu2012-06-021-86/+136
| | | | | | | | | | | | | | 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
* * lib/ipaddr.rb: Improve documentation. Patch by Sandor Szucs.drbrain2011-05-221-0/+16
| | | | | | | [Ruby 1.9 - Bug #4753] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib: revert r31635-r31638 and untabify with expand(1).nobu2011-05-191-10/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib: Convert tabs to spaces for ruby files perdrbrain2011-05-181-33/+33
| | | | | | | | | 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
* * lib/ipaddr.rb (unless Socket): Document valid*? methods. Patch bydrbrain2011-05-131-0/+3
| | | | | | | Sebastian Martinez. [Ruby 1.9 - Feature #4687] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/resolv-replace.rb: specify super class for rdoc.akr2010-03-211-1/+1
| | | | | | | | * lib/ipaddr.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib: fixed typo. a patch by Sho Hashimoto in [ruby-dev:40716].nobu2010-03-201-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ipaddr.rb (IPAddr#hash): Take account of netmask; submittedknu2009-08-051-5/+7
| | | | | | | | by Nobuhiro IMAI in [ruby-dev:39011] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ipaddr.rb (IPAddr#{eql?,hash}): Add IPAddr#{eql?,hash} soknu2009-08-041-0/+35
| | | | | | | | | 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
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-9/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added changes needed for miniunit. usually from using internal calls that ↵ryan2008-09-231-1/+0
| | | | | | aren't needed anymore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ipaddr.rb (IPAddr#initialize): get rid of ArgumentError innobu2008-07-071-1/+1
| | | | | | | | 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
* * lib/ipaddr.rb: Say that I am the current maintainer.knu2008-03-211-0/+4
| | | | | | | | | | | * 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
* * lib/ipaddr.rb (in_addr, in6_addr, addr_mask): Make some minorknu2007-10-041-14/+6
| | | | | | | code optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ipaddr.rb (<=>): Implement IPAddr#<=> and make IPAddrknu2007-10-041-0/+31
| | | | | | | | | | | | | | 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
* * lib/ipaddr.rb (coerce_other): Support type coercion and make &,knu2007-10-041-34/+55
| | | | | | | | | | | | |, == 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
* Move Example so RDoc picks it up.drbrain2006-08-041-23/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Documentation cleanup.drbrain2006-08-041-15/+15
| | | | | | | | | | 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
* * object.c (rb_mod_attr): make Module#attr to be an alias tomatz2006-07-201-1/+1
| | | | | | | | | | 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
* * lib/ipaddr.rb (test_s_new): typo.usa2005-01-191-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ipaddr.rb (to_s, test_to_s): too many colons with some cases.usa2005-01-191-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/ipaddr.rb (initialize): rescue StandardError.eban2003-12-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ipaddr.rb (IPSocket::getaddress): merge usa's patch.eban2003-12-181-3/+53
| | | | | | | [ruby-dev:21678] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (Init_socket): IPv6 is not supported althougheban2003-12-141-0/+12
| | | | | | | | | | 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
* * lib/ipaddr.rb (include?): Support non-IPAddr parameters by Dave Thomas. ↵nobu2003-04-241-3/+13
| | | | | | [ruby-core:00980] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * MANIFEST, lib/README, lib/ipaddr.rb: Add ipaddr.rb from rough.knu2002-12-231-0/+690
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e