- 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
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
* 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
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 (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
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
all platforms. [ruby-dev:45671]
* lib/ipaddr.rb: Allow the 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
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
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
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
|, == 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
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