Граф коммитов

288 Коммитов

Автор SHA1 Сообщение Дата
naruse 04883f12c8 Introduce URI::File to handle file URI scheme
* the default value of URI::File's authority is "" (localhost).
  Both nil and "localhost" is normalized to "" by default.
* URI::File ignores setting userinfo and port
[Feature #14035]
fix https://github.com/ruby/ruby/pull/1719
fic https://github.com/ruby/ruby/pull/1832

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-15 16:51:31 +00:00
naruse 6db869c101 fix error if the input is mixed Unicode and percent-escapes
Reported by kivikakk (Ashe Connor) with tests and doc fix
Patch based on mame and fix by naruse
[Bug #14586]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-08 09:38:01 +00:00
normal 26b3dc4922 uri/common: reduce allocations and retained objects
Thanks to Sam Saffron for this patch, it shows
a nice reduction which affects many web applications:

  require 'memory_profiler'

  MemoryProfiler.report do
    require 'uri'
  end.pretty_print

Before:

Total allocated: 986643 bytes (15159 objects)
Total retained:  246370 bytes (2532 objects)

After:

Total allocated: 926903 bytes (13665 objects)
Total retained:  208570 bytes (1587 objects)

* lib/uri/common.rb: reduce allocations and retained objects
  [ruby-core:85161] [Feature #14410]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-28 21:07:13 +00:00
naruse 84bade6aa7 Use string instead of regexp
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14 06:30:22 +00:00
knu b53ec390d1 Allow empty path components in a URI [Bug #8352]
* generic.rb (URI::Generic#merge, URI::Generic#route_to): Fix a bug
  where a sequence of slashes in the path part gets collapsed to a
  single slash.  According to the relevant RFCs and WHATWG URL
  Standard, empty path components are simply valid and there is no
  special treatment defined for them, so we just keep them as they
  are.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14 01:11:28 +00:00
shyouhei f2a91397fd Add uplevel keyword to Kernel#warn and use it
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-12-12 11:56:25 +00:00
naruse ed48bfa5e8 Append "//" if empty host for file or postgres URI
https://url.spec.whatwg.org/#url-serializing
> Otherwise, if url’s host is null and url’s scheme is "file", append "//" to output.

URL spec doesn't says anything about postgres, but assume the same thing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-01 15:09:41 +00:00
kazu dabdec31e4 Use caller with length to reduce unused strings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21 14:40:03 +00:00
naruse ec7c76c446 URI::Generic: Separate no_proxy handling
To share with Net::HTTP. see #11195

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-28 10:51:31 +00:00
hsbt 21f6916b98 Remove commented out code of URI::HTTP.new.
[Misc #13871][ruby-core:82655] Patch by @aycabta

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-11 06:12:40 +00:00
nobu 16565fa2d7 ftp.rb: fix example format [ci skip]
* lib/uri/ftp.rb: [DOC] fix format of example URLs.  patched by
  aycabta (Code Ahss) at [ruby-core:82379].  [Bug #13814]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-15 01:05:50 +00:00
sonots 10ee38b6bc * lib/uri/common.rb: [DOC] add rdoc to describe
URI.unescape is obsolete [ci-skip] [fix GH-1630]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-26 06:42:11 +00:00
stomar dba186ebc7 lib/uri/generic.rb: fix typos
* lib/uri/generic.rb: [DOC] fix typos in URI::Generic#== docs.
  Patch by Alyssa Ross (alyssais).  [Fix GH-1604]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-10 19:03:07 +00:00
stomar 58c3935ec9 improve docs for URI::Generic
* lib/uri/generic.rb: [DOC] expand docs for URI::Generic#normalize
  to clarify what normalization means here.
  Reported by Robert Gleeson.  [ruby-core:58430] [Bug #9127]

* lib/uri/generic.rb: [DOC] fix indent for correct code block detection.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19 15:01:05 +00:00
naruse 6219b68fb5 Fix typo of URI#escape [Bug #13147]
patched by Steve Hill <sghill.dev@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-23 17:02:08 +00:00
nobu 556e3da421 uri/generic.rb: fix exception on non-IP format
* lib/uri/generic.rb (URI::Generic#find_proxy): match IP address
  no_proxy against resolved self IP address.  [Fix GH-1513]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-17 12:54:35 +00:00
naruse 6c0aece53d Use URI.decode_www_form_component [Bug #10774]
`parser` refered RFC2396_Parser, but it is separated.
test is contributed by Dominik Menke

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-12 15:24:28 +00:00
kazu 5660bb929f Use `&.` instead of `if` and `? :`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-22 23:44:51 +00:00
a_matsuda 41cc7eaa7e Update comment about default constant
Patch by: Dave Takahashi <dtcello@gmail.com> (@dtakahas)
Signed-off-by: Akira Matsuda <ronnie@dio.jp>

closes #1151

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-08 11:57:00 +00:00
nobu 587a24609b uri/generic.rb: Tidy up merge
* lib/uri/generic.rb (URI::Generic#merge): merge merge0.
  [GH-1469]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-31 02:08:54 +00:00
hsbt 13e474f035 * lib/uri/common.rb: added documentation for deprecated method.
[Misc #11960][ruby-core:72733][ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-20 08:03:01 +00:00
akr a44f5878f2 forgot to replace two occurences of ENV.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-11 16:42:05 +00:00
akr 1ab0740838 Add an optional argument, env, to URI.find_proxy.
* lib/uri/generic.rb (URI.find_proxy): Add an optional argument, env.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-11 07:53:56 +00:00
nobu a566bc0a38 uri/common.rb: Update URI::WEB_ENCODINGS_ [ci skip]
* lib/uri/common.rb (WEB_ENCODINGS_): split command lines and
  append a trailing comma.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-06 02:04:28 +00:00
nobu 48f9118253 Update URI WEB_ENCODINGS_ hash, and fix documented cmd to
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-06 02:01:51 +00:00
hsbt 107ba65fba * lib/uri/http.rb: Documentation and code style imrovements.
* test/uri/test_http.rb: Added test for coverage.
  [fix GH-1427][ruby-core:77255][Misc #12756]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-30 10:06:24 +00:00
tenderlove c2cbd5528c Don't include bad password in URI exception output
We shouldn't include the bad password in the URI exception output
message.  Just knowing that there is a bad password is enough
information.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-15 21:44:56 +00:00
hsbt 52f9d387e6 * lib/uri/mailto.rb: Removed needless `return` and use `.`` instead of `::`
with class method.
* test/uri/test_mailto.rb: Added tests for coverage.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-12 04:46:27 +00:00
naruse 79f86a67d0 * lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaque
only if the URI has path-rootless, not path-empty.
  [ruby-core:76055] [Bug #12498]
  patched by Chris Heisterkamp <cheister@squareup.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-02 09:05:05 +00:00
akr 449fbfd4d4 Use Integer instead of Fixnum and Bignum.
* object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c,
  lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb,
  lib/rubygems/specification.rb, lib/uri/generic.rb,
  bootstraptest/test_eval.rb, basictest/test.rb,
  test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb,
  test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb,
  test/csv/test_data_converters.rb, test/date/test_date.rb,
  test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb,
  test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb,
  test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb,
  test/ruby/test_bignum.rb, test/ruby/test_case.rb,
  test/ruby/test_class.rb, test/ruby/test_complex.rb,
  test/ruby/test_enum.rb, test/ruby/test_eval.rb,
  test/ruby/test_iseq.rb, test/ruby/test_literal.rb,
  test/ruby/test_math.rb, test/ruby/test_module.rb,
  test/ruby/test_numeric.rb, test/ruby/test_range.rb,
  test/ruby/test_rational.rb, test/ruby/test_refinement.rb,
  test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb,
  test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb,
  test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17 13:15:57 +00:00
nobu 1ac12c4056 fix URI::HTTP.new example
* lib/uri/http.rb (URI::HTTP#initialize): [DOC] fix example,
  missing mandatory arguments.  [ruby-core:74540] [Bug #12215]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-25 02:08:39 +00:00
nobu 1ee9cad027 CIDR in no_proxy
* lib/uri/generic.rb (URI::Generic#find_proxy): support CIDR in
  no_proxy.  [ruby-core:73769] [Feature#12062]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-13 08:31:12 +00:00
nobu 423d042371 no_proxy with whitespaces and leading dots
* lib/uri/generic.rb (find_proxy): exclude white-spaces and allow
  for a leading dot in the domain name in no_proxy.
  [ruby-core:54542] [Feature #8317]

The previous implementation wouldn't allow for white-spaces nor a leading dot
in the domain name. The latter is described in the wget documentation as a valid case.

By being more strict on the characters, which are counted to a domainname,
we allow for white-spaces.
Also, a possible leading dot will be handled gracefully.

[Fix GH-285]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-13 08:12:21 +00:00
naruse aa90e3b859 * lib/uri/generic.rb (URI::Generic#to_s): change encoding to
UTF-8 as Ruby 2.2/ by Koichi ITO <koic.ito@gmail.com>
  https://github.com/ruby/ruby/pull/1188 fix GH-1188

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-14 11:20:24 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
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-12-16 05:07:31 +00:00
hsbt 68b69178f4 * lib/uri/common.rb: make code block for rdoc.
[ci skip][fix GH-1152] Patch by @Tonkpils

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-15 02:56:38 +00:00
hsbt 059c9c1cf3 * ext/socket/lib/socket.rb: use safe navigation operator.
[fix GH-1142] Patch by @mlarraz
* lib/drb/extservm.rb: ditto.
* lib/net/http.rb: ditto.
* lib/net/http/response.rb: ditto.
* lib/scanf.rb: ditto.
* lib/uri/generic.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14 08:05:35 +00:00
normal f2b9563bb4 lib/uri/generic.rb: enable frozen_string_literal
* lib/uri/generic.rb: enable frozen_string_literal
  (split_userinfo): remove explicit .freeze for string literals
  (check_path): ditto
  (query): ditto
  (fragment): ditto
  (to_s): ditto
  [ruby-core:71910] [Bug #11759]

Patch-by: Colin Kelley <colindkelley@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 21:28:26 +00:00
hsbt baddc0cbf9 * lib/uri/ftp.rb: fix a typo.
[fix GH-1084][ci skip] Patch by @windwiny

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-08 01:38:06 +00:00
naruse 8c7310e713 * lib/uri/rfc2396_parser.rb (initialize_pattern):
URI::Generic.build should accept port as a string.
  pattern[:PORT] is not defined for long.
  by Dave Slutzkin <daveslutzkin@fastmail.fm>
  https://github.com/ruby/ruby/pull/804 fix GH-804

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 02:34:47 +00:00
marcandre 0c4631b880 * lib/uri: [doc] Update common.rb [ci-skip] [fixes GH-838]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-24 18:09:10 +00:00
duerst e3c4c7e13b * lib/uri/mailto.rb: raising URI::InvalidComponentError instead
of failing with undefined method `split' for nil:NilClass for
  mailto: URIs without opaque part. [Bug #10738]
* test/uri/testuri.rb: Test for above

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-14 09:06:13 +00:00
duerst b1cf08496b lib/uri/common.rb: Initialize HTML5ASCIIINCOMPAT to empty Array
to avoid error during bootstrap when encodings are not yet defined. [Bug #10678]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-30 04:17:10 +00:00
normal aa93c62e3c lib/uri: performance improvements [misc #10628]
* lib/uri/generic.rb (split_userinfo): fstring for 1-byte split
  (set_port): reduce bytecode size
  (check_path): reduce garbage via opt_str_freeze
  (query=): ditto
  (fragment=): ditto
  [misc #10628]
* lib/uri/rfc3986_parser.rb (regexp): cache as attr
  (initialize): setup and freeze regexp attr once
  (split): reduce bytecode size, use opt_str_freeze
  (parse): minor bytecode and garbage reduction
  (default_regexp): rename for initialize

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-24 23:50:37 +00:00
naruse 30fef86b38 * lib/uri/generic.rb (URI::Generic#query=): don't escape [\]^
on both rfc2396 and rfc3986. [Bug #10619]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-23 13:11:43 +00:00
naruse e1606f920b * lib/uri/generic.rb (URI::Generic.build):
use hostname= to detect and wrap IPv6 hosts.
  Build is accepting URI components and users may not expect
  that a host component needs to be wrapped with square brackets
  since it's not providing a URI.
  Note: initialize with arg_check => true does not wrap IPv6 hosts.
  by Joe Rafaniello <jrafanie@redhat.com>
  https://github.com/ruby/ruby/pull/765 fix GH-765

* test/uri/test_generic.rb: Add more tests

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01 17:36:54 +00:00
usa 0a71befc6b * lib/uri/mailto.rb (URI::MailTo::EMAIL_REGEXP): should escape `#`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-20 15:19:17 +00:00
normal f83116e620 lib/uri/rfc2396_parser.rb (initialize): reduce bytecode size
Reduce the initialize method from 2088 to 1332 bytes on 32-bit x86
Measurement obtained using `memsize_of_all', as `memsize_of'
is non-recursive:

  a = ObjectSpace.memsize_of_all(RubyVM::InstructionSequence)
  RubyVM::InstructionSequence.compile(src)
  b = ObjectSpace.memsize_of_all(RubyVM::InstructionSequence)
  p(b - a)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-06 01:14:15 +00:00
naruse 21ab98a997 * lib/uri/rfc3986_parser.rb (URI::RFC3986_Parser::RFC3986_URI):
allow '[' and ']' for URI input (and escape). [Bug #10402]

* lib/uri/generic.rb (URI#query=): escape '[', '\', and ']'.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-03 00:33:47 +00:00
naruse 6041af45a3 * lib/uri/generic.rb (URI#inspect): remove Object id.
URI is considered that it doesn't require id.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-07 22:48:06 +00:00
glass a4645e5612 * lib/uri/rfc3986_parser.rb: raise URI::InvalidURIError when
uri doesn't respond to #to_str. [ruby-core:64453] [Bug #10150]

* test/uri/test_parser.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-27 03:13:22 +00:00
naruse e37aab94da * lib/uri/rfc3986_parser.rb: specify a regexp for :OPAQUE; generic.rb
assumes it is present, and will refuse all values otherwise.
  by Matthew Draper <matthew@trebex.net>
  https://github.com/ruby/ruby/pull/718 fix GH-718

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-17 14:15:03 +00:00
hsbt e47fec1f86 * lib/drb/acl.rb: Removed meaningless #to_s methods in interpolation.
[Feature #10174][ruby-core:64584]
* lib/erb.rb: ditto.
* lib/observer.rb: ditto.
* lib/rake/invocation_chain.rb: ditto.
* lib/rubygems/command_manager.rb: ditto.
* lib/rubygems/config_file.rb: ditto.
* lib/uri/common.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-27 12:21:41 +00:00
nobu 682f3a7881 uri/common.rb: use negative look-ahead
* lib/uri/common.rb (URI.decode_www_form_component): use negative
  look-ahead instead of nested repeat operators, to get rid of
  backtrack explosion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-25 07:29:50 +00:00
naruse b6ecbc7055 remove path_query
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-05 19:09:08 +00:00
naruse d7b5ef028b * lib/uri/generic.rb (URI::Generic#normalize!): use String#empty?
* lib/uri/generic.rb (URI::Generic#path_query): optimized.

* lib/uri/generic.rb (URI::Generic#to_s): optimized.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-05 19:09:05 +00:00
naruse a5c923f6c1 * lib/uri/http.rb (URI::HTTP#request_uri): optimized.
decrease object allocation, and ensure always create at least one new
  object for return value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-05 19:09:01 +00:00
zzak 747243cc0e * lib/uri/common.rb: [DOC] [Bug #9563] Recommend using URI.escape
before parsing a uri to avoid invalid characters. Reported by
  Evgeniy Serykh.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-27 21:27:10 +00:00
zzak 37fd832f3c * lib/uri/common.rb: [DOC] [Bug #10075] Clarify how URI.join arguments
are handled by RFC3986, originall reported by John Feminella.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-27 20:34:18 +00:00
hsbt 4b8f0e7637 * lib/shell/command-processor.rb: remove unused variable.
* lib/shell/system-command.rb: ditto.
* lib/tmpdir.rb: ditto.
* lib/uri/generic.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-26 17:44:07 +00:00
naruse 7af7388202 * lib/uri/generic.rb (URI::Generic#query=): remove validation, just
escape. [Feature #2542]

* lib/uri/generic.rb (URI::Generic#fragment=): ditto.

* lib/uri/generic.rb (URI::Generic#check_query): removed.

* lib/uri/generic.rb (URI::Generic#set_query): ditto.

* lib/uri/generic.rb (URI::Generic#check_fragment): ditto.

* lib/uri/generic.rb (URI::Generic#set_fragment): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-03 18:00:08 +00:00
naruse b105cbc809 suppress warnings: assigned but unused variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-30 10:11:02 +00:00
naruse 48559765b1 remove useless part of regexp
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-30 10:06:25 +00:00
naruse e63ab5d3ad * lib/uri/mailto.rb: update to latest specs, RFC 6068 and HTML5.
* lib/uri/mailto.rb (HEADER_PATTERN): removed.

* lib/uri/mailto.rb (HEADER_REGEXP): use RFC 6068 hfields.

* lib/uri/mailto.rb (EMAIL_REGEXP): use HTML5 email regexp.

* lib/uri/mailto.rb (URI::MailTo.build): support multiple to addresses.

* lib/uri/mailto.rb (URI::MailTo#initialize): Support multiple to
  addresses. Don't check with regexp, only split.

* lib/uri/mailto.rb (URI::MailTo#check_to): verify by matching
  URI path-rootless and HTML5 email regexp with unescaped one.

* lib/uri/mailto.rb (URI::MailTo#check_headers): verify only by
  HEADER_REGEXP.

* lib/uri/mailto.rb (URI::MailTo#set_headers): don't check by
  HEADER_REGEXP, only split it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-27 19:26:43 +00:00
naruse a054854324 Revert "* lib/uri/mailto.rb: support RFC6068."
to fix mailto URI syntax

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-24 02:58:45 +00:00
naruse a672789739 * lib/uri/mailto.rb: support RFC6068.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-23 20:01:27 +00:00
naruse e02eb253e7 * lib/uri/generic.rb (check_port): allow strings for port= as
described in rdoc.

* lib/uri/rfc3986_parser.rb (regexp): implementation detail of above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-23 03:18:51 +00:00
naruse c7a7e60409 remove registry
'registry' is not used and RFC3986 doesn't use it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-22 00:24:11 +00:00
naruse b757ff3ef6 * lib/uri/rfc3986_parser.rb: raise exception when given a URI string has non ASCII.
It is to keep the regexp compiled for US-ASCII.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-22 00:23:52 +00:00
naruse bb83f32dc3 support RFC3986 [Feature #2542]
* lib/uri/common.rb (URI::REGEXP): move to lib/uri/rfc2396_parser.rb.

* lib/uri/common.rb (URI::Parser): ditto.

* lib/uri/common.rb (URI.split): use RFC3986_Parser.

* lib/uri/common.rb (URI.parse): ditto.

* lib/uri/common.rb (URI.join): ditto.

* lib/uri/common.rb (URI.extract): deprecated.

* lib/uri/common.rb (URI.regexp): ditto.

* lib/uri/rfc2396_parser.rb: added.

* lib/uri/rfc3986_parser.rb: added.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-22 00:22:19 +00:00
naruse 97d36e5bd0 lib/uri/mailto.rb (initialize): as previous commit, fix arg_check
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-22 00:22:15 +00:00
naruse c56dab2ceb fix that arg_check didn't work
* lib/uri/ftp.rb (initialize): arg[-1] was fragment, but it must be arg_check.

* lib/uri/ftp.rb (initialize): explicitly specify arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-22 00:21:57 +00:00
zzak 63da4ce3bc * lib/uri/common.rb: [DOC] Use static w3.org uri [ci skip]
Patch by @ykzts [Fix GH-484] https://github.com/ruby/ruby/pull/484


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-21 08:56:15 +00:00
hsbt 690be750cb * lib/cgi/html.rb: fix typo by @windwiny [fix GH-506]
*  lib/net/http.rb: ditto
*  lib/rexml/attribute.rb: ditto
*  lib/rexml/element.rb: ditto
*  lib/rexml/source.rb: ditto
*  lib/rexml/streamlistener.rb: ditto
*  lib/rss/xmlparser.rb: ditto
*  lib/rubygems/commands/generate_index_command.rb: ditto
*  lib/shell.rb: ditto
*  lib/uri/common.rb:ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 05:43:26 +00:00
a_matsuda 54fdf15ad4 * lib/uri/generic.rb: [DOC] Fix typo
s/andn/and/
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-21 07:41:13 +00:00
hsbt 967677aba0 * lib/uri/common.rb: [DOC] Fix a broken link by @namusyaka [fix GH-478]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13 23:22:41 +00:00
a_matsuda 214aacff74 * lib/uri/generic.rb: [DOC] Fix typo
s/arguement/argument/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29 14:43:01 +00:00
zzak 217d37a64a * lib/uri/common.rb: [DOC] typo fixes by @vipulnsward [Fixes GH-456]
https://github.com/ruby/ruby/pull/456
* lib/uri/generic.rb: [DOC] ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-25 10:49:29 +00:00
naruse 80d8216415 * lib/uri/generic.rb (URI::Generic.find_proxy): return nil if
http_proxy environment variable is empty string.
  [ruby-core:57140] [Bug #8898]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-13 04:57:25 +00:00
knu 601f783827 * lib/uri/common.rb (URI.decode_www_form_component): Use String#b.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-31 09:34:34 +00:00
sorah b30a172385 * lib/uri/common.rb (URI.decode_www_form_component):
Don't raise error when str includes multibyte characters.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-31 09:00:18 +00:00
naruse 6398f79853 * lib/uri/generic.rb (find_proxy): raise BadURIError if the URI is
a relative URI. [Bug #8645]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-24 10:52:15 +00:00
naruse 53fdb30e7f * lib/uri/common.rb (URI.decode_www_form): scrub string if decoded
bytes are invalid for the encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-18 18:58:13 +00:00
naruse 4a50d447d9 * lib/uri/common.rb (URI.decode_www_form): follow current URL Standard.
It gets encoding argument to specify the character encoding.
  It now allows loose percent encoded strings, but denies ;-separator.
  [ruby-core:53475] [Bug #8103]

* lib/uri/common.rb (URI.decode_www_form): follow current URL Standard.
  It gets encoding argument to convert before percent encode.
  Now UTF-16 strings aren't converted to UTF-8 before percent encode
  by default.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-25 05:27:41 +00:00
hsbt e9a61266fc fix typo by @zsalzbank [fix GH-289]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-17 01:16:58 +00:00
hsbt e0b523d1a9 Finish docs for URI::FTP by @darkhelmet [fix GH-274]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-09 00:29:54 +00:00
zzak 87d3c2d6d4 * lib/uri/ftp.rb (URI::FTP.new2): nodoc method from r39013 [Bug #7301]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-02 03:31:56 +00:00
mame a60a562ca7 * lib/uri/ftp.rb (URI::FTP.new2): remove the rdoc because it is not
well tested yet.  [Bug #7301]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-02 03:18:40 +00:00
zzak 0ba78cb2f7 * lib/uri/http.rb (URI::HTTP.build): Fix example
Patch by Carina C. Zona
  [Fixes #209 Github]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-05 01:19:09 +00:00
naruse 37cc18d54b * lib/uri/ftp.rb (URI::FTP#initialize): raise InvalidURIError if "//"
is not present [ruby-core:47344] [Bug #6945]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-30 00:22:11 +00:00
drbrain 9416becda4 * lib/net/http.rb: Net::HTTP now automatically detects and uses
proxies from the environment.  A proxy may also be specified as
  before.

  Net::HTTP::Proxy still creates anonymous classes, but these classes
  are only used to store configuration information.  When an HTTP
  instance is created the configuration is now copied.

  Additionally, Net::HTTP::ProxyDelta is no longer used by Net::HTTP

  [Feature #6546]
* lib/open-uri.rb:  Moved URI::Generic#find_proxy to uri/generic.
* lib/uri/generic.rb:  Imported find_proxy from open-uri.
* test/open-uri/test_open-uri.rb:  Moved proxy-discovery tests to URI.
* test/uri/test_generic.rb:  Imported proxy-discovery tests from
  open-uri.
* test/net/http/test_http.rb:  Added tests for proxy behavior.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-20 01:56:21 +00:00
naruse 9381cd1184 * lib/uri/generic.rb (URI::Generic.build): duplicate args before adding
new items. (don't change arguments)

* lib/uri/generic.rb (URI::Generic.build): use URI::Generic::COMPONENT
  if this method is called from URI::Generic.

* lib/uri/generic.rb (URI::Generic.build2): escape only if the item is
  a String.

* lib/uri/generic.rb (URI::Generic.build2): use DEFAULT_PARSER because
  it doesn't have parser method. [Bug #6420]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-18 07:32:08 +00:00
drbrain 655738577f * lib/uri/generic.rb (module URI): URI now downcases the scheme to
follow RFC 2396 section 3.1.  [ruby-trunk - Feature #4551]
* test/uri/test_generic.rb (class URI):  Test for above


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11 22:11:07 +00:00
naruse edb7cdf1ea * lib/uri/common.rb (URI.encode_www_form_component): initialize on
requiring to support JRuby, which runs parallel multithreads.
  [ruby-core:42222] [Bug #5925]

* lib/uri/common.rb (URI.decode_www_form_component): initialize on

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-24 02:52:09 +00:00
naruse 44d7233201 * lib/uri/mailto.rb (URI::MailTo.build): follow Array#to_s change of
Ruby 1.9; use Array#join. [Bug #5840]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-23 08:12:52 +00:00
naruse 87fe448091 * lib/uri/common.rb (URI::Parser#initialize_regexp):
use \A \z instead of ^ $. [Bug #5843]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-05 02:57:21 +00:00
tenderlove 7cabeff61a updating documentation link
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-18 03:16:05 +00:00
ktsj c3749b6a6d * ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,
ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb,
  lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb,
  lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb,
  lib/rinda/tuplespace.rb, lib/rss/maker/base.rb,
  lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb,
  lib/shell/command-processor.rb, lib/shell/process-controller.rb,
  lib/shell/system-command.rb, lib/uri/common.rb: remove unused block
  arguments to avoid creating Proc objects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05 07:37:47 +00:00
naruse 32618ba743 Add a missing parenthesis in the example.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24 07:28:12 +00:00
drbrain ee13ed7e84 * lib/uri/common.rb: Fix documentation of URI::Parser.new. Patch by
Steve Klabnik.  [Ruby 1.9 - Bug #5177]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-12 18:41:57 +00:00
naruse 93177c1e5c Fix r32622.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 21:16:50 +00:00
naruse b5f91deee0 * lib/uri/generic.rb (WFKV_): unroll the loop of regexp.
* lib/uri/generic.rb (URI.decode_www_form_component): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 12:29:13 +00:00
marcandre c2dfaa7d40 * lib/uri/common.rb (module): Remove optional parser argument to Kernel#URI
[ruby-core:38061]

* lib/uri/generic.rb (module): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-15 21:28:10 +00:00
naruse a83f125c31 * lib/net/http.rb (URI::HTTP#request_uri): return nil when the uri
is path-rootless form. Bug #4759

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-03 00:32:25 +00:00
nobu d371e3583e * lib: revert r31635-r31638 and untabify with expand(1).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-19 00:07:25 +00:00
drbrain 7bbf2f3085 * lib: Convert tabs to spaces for ruby files per
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-18 21:19:18 +00:00
nobu 3a47cf3395 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 11:55:52 +00:00
drbrain 10219ff621 * lib/uri.rb: Add toplevel documentation. Patch by Vincent Batts.
[Ruby 1.9 - Bug #4690]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-13 20:03:21 +00:00
nagachika 58355ea52a * lib/logger.rb: format comments to keep 80 columns in a line.
* lib/uri/common.rb: ditto.
  * lib/uri/ftp.rb: ditto.
  * lib/uri/ldap.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-13 12:54:57 +00:00
drbrain e2b3183fc2 * re.c (Init_Regexp): Document option constants. Patch by Vincent
Batts.  [Ruby 1.9 - Bug #4677]
	* lib/uri/common.rb (module URI):  Documentation for URI.  Patch by
	  Vincent Batts.  [Ruby 1.9- Bug #4677]
	* lib/uri/ftp.rb (module URI):  ditto
	* lib/uri/generic.rb (module URI):  ditto
	* lib/uri/http.rb (module URI):  ditto
	* lib/uri/https.rb (module URI):  ditto
	* lib/uri/ldap.rb (module URI):  ditto
	* lib/uri/ldaps.rb (module URI):  ditto
	* lib/uri/mailto.rb (module URI):  ditto
	* process.c (Init_process):  Document Process constants.  Patch by
	  Vincent Batts.  [Ruby 1.9- Bug #4677]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-12 20:39:11 +00:00
drbrain 83d7aca7f6 * Various .document files: Update .document files to match files which
have documentation.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-11 22:31:17 +00:00
knu 835693dac5 * lib/uri/generic.rb (#route_from_path): Fix a bug where
URI('http://h/b/').route_to('http://h/b') wrongly returned './'
  (should be '../b'). [Bug #4476]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-15 06:13:08 +00:00
naruse 8553b70a39 * lib/uri/common.rb: avoid race condition. fixes #4572
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-12 10:20:50 +00:00
naruse 68b18291ac * lib/uri/common.rb (URI::Parser#initialize_pattern):
refix for restrict the pattern.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-06 01:41:10 +00:00
naruse 2a35a782ab * lib/uri/common.rb (URI::Parser#initialize_pattern):
workaround fix pattern of hostname for RFC 3986. [ruby-dev:42672]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-06 00:19:28 +00:00
naruse e41ed50bf0 * lib/uri/common.rb (URI.encode_www_form):
split key-value when the value is Array like object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02 04:33:56 +00:00
drbrain ff3e943d1f Improve documentation for URI::Common#encode_www_form, OpenSSL::SSL::SSLContext#ssl_version=.
Add documentation for OpenSSL::SSL::SSLContext#ciphers

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-29 20:23:59 +00:00
nobu 839ee60687 * lib/uri/common.rb (URI::WFKV_): get rid of backtrack explosion
by nested repeat operators.  [ruby-core:33464]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-29 13:55:27 +00:00
akr 5fd45a4b79 * lib/uri/generic.rb (URI::Generic#hostname): new method.
(URI::Generic#hostname=): ditto.

* lib/open-uri.rb: use URI#hostname

* lib/net/http.rb: ditto.

  [ruby-core:32056]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-06 03:30:49 +00:00
naruse c4087bcb12 * lib/uri/common.rb (URI.encode_www_form): change treatment of
undefined value in given array as latest internet draft for
  application/www-form-urlencoded.
  http://tools.ietf.org/html/draft-hoehrmann-urlencoded-01

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-30 00:48:01 +00:00
naruse d339fed3ad Add document about URI.join. [ruby-core:32462]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-23 12:22:43 +00:00
marcandre 5647b2cd88 * lib/uri/common.rb: Have URI#route_to, URI#route_from accept
string-like arguments [ruby-core:30961]

* lib/uri/generic.rb: ditto for URI.join, URI#merge

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-21 04:38:40 +00:00
marcandre 770af8649a * lib/uri/common.rb: Have URI() and URI.join accept URI objects in addition
to strings. [ruby-core:30960]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-21 03:32:41 +00:00
marcandre 3b0e399c03 * lib/uri/mailto.rb: clean up regexp [ruby-core:29894]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-11 04:49:56 +00:00
mame 8588e7631e * lib/uri/ftp.rb (URI::FTP#set_path): added to correct handling of
special case where path of ftp is relative.  This converts relative
  path to absolute one, because external representation of ftp path is
  relative and internal representation is absolute.  [ruby-core:24077]

* lib/uri/ftp.rb (URI::FTP#initialize): converts absolute to relative.

* lib/uri/generic.rb (URI::Generic#check_path): allow relative path
  when scheme is ftp.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-15 13:41:19 +00:00
naruse 9e30f60dbf * lib/uri/common.rb (decode_www_form_component): validate.
[ruby-dev:40938]

* lib/uri/common.rb (decode_www_form): allow empty string.

* lib/uri/common.rb: fix nodoc for constant. [ruby-dev:40949]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-10 22:05:02 +00:00
naruse 8a3c3b9c95 * lib/uri/common.rb (decode_www_form): don't ignore leading '?'.
[ruby-dev:40938]

* lib/uri/common.rb (decode_www_form): check whether argument is
  valid application/x-www-form-urlencoded data.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-09 11:58:20 +00:00
naruse e9cfe47700 Add description about de facto FTP URI spec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-09 08:15:33 +00:00
naruse 83c2f60b88 * lib/uri/common.rb (URI.encode_www_form_component):
convert strings of HTML5 ASCII incompatible encoding
  to UTF-8.

* lib/uri/common.rb (URI.encode_www_form_component):
  "\x83\x41" of Shift_JIS should be encoded as "%83A".
  This follows real implementations.

* lib/uri/common.rb (URI.decode_www_form_component):
  use given encoding for force_encoding. [ruby-dev:40721]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-21 12:36:14 +00:00
naruse f626a17d8c * lib/uri/common.rb (URI#{en,de}code_www_form_component):
renamed from URI#{en,de}code_www_component. [ruby-dev:40672]

* lib/uri/common.rb (URI#encode_www_form_component): %-encoded
  element should have always two hex.

* lib/uri/common.rb (URI#encode_www_form_component):
  better treatment for ASCII incompatible encodings and
  encodings whose lead byte may use 7bit.

* lib/uri/common.rb (URI#decode_www_form_component): add %20.

* lib/uri/common.rb (URI#decode_www_form_component): add
  result's encoding as 2nd argument.

* lib/uri/common.rb (URI#decode_www_form): added.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-17 15:35:38 +00:00
naruse 7588f09a87 * lib/uri/common.rb (URI.encode_www_component):
call str.to_s at first.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-15 00:42:25 +00:00
naruse 8212cdf176 * lib/uri/common.rb (URI.encode_www_form): new method to
generate URL-encoded form data. [ruby-dev:39246]

* lib/uri/common.rb (URI.encode_www_component,
  URI.decode_www_component): new method for encode/decode
  a name/value of HTML form.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-12 09:00:48 +00:00
naruse 7aab2aad6e * lib/uri/common.rb (initialize_regexp): allow leading
and trailing white space, and forbid extra characters
  on another lines. [ruby-core:26223]
  RFC 3986  Appendix C.  Delimiting a URI in Context
  draft-duerst-iri-bis-07  7.2.  Web Address processing

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-01 16:00:46 +00:00
naruse 17ff65205c * lib/uri/generic.rb (URI#normalize!): normalize case of
scheme. [ruby-core:27309]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-01 16:00:37 +00:00
marcandre dbb14e218a * lib/uri/generic.rb (eql?): Check the class of the compared object.
Based on a patch by Peter McLain [ruby-core:27019]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-24 07:33:24 +00:00
naruse 238b979f17 * lib/uri/common.rb (URI.escape): obsoleted.
* lib/uri/common.rb (URI,unescape): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-06 18:24:53 +00:00
akr 0fd221bd78 * lib/uri: don't set @parser if it is DEFAULT_PARSER for marshaling
URI objects between Ruby 1.8 and Ruby 1.9.
  [ruby-dev:38377]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-27 17:48:54 +00:00
nobu 287a34ae0d * {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06 03:56:38 +00:00
nobu 3f0060c042 * lib/uri/common.rb (URI::Parser#escape): escaped string is ascii
only.

* lib/uri/common.rb (URI::Parser#unescape): converts bytewise.
  [ruby-dev:38005], [ruby-dev:38110]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-02 10:43:04 +00:00
matz 8bc28d82b4 * lib/uri/generic.rb (URI::Generic#check_path): REL_PATH should a
symbol.  [ruby-core:19805]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-11 17:39:52 +00:00
drbrain 563b654437 Fix ruby -w warnings for mismatched indentation discovered by rdoc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 18:16:08 +00:00
mame 4046a1cb92 * lib/uri/common.rb (unescape): skip '%' to make String#hex work
correctly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-18 11:05:09 +00:00
akira 3da03397ce * lib/uri/common.rb (URI::Parser): new class.
* lib/uri/mailto.rb, lib/uri/generic.rb: follow the above change.

	* test/uri/test_parser.rb: added tests for URI::Parser.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-10 09:34:49 +00:00
naruse a8739621cf * lib/uri/generic.rb: revert r15442. 2nd argument of String#sub parse
escapes. [ruby-dev:33726]

* bootstraptest/test_method.rb enc/depend instruby.rb lib/mkmf.rb
  mkconfig.rb: revert r15443. ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 07:26:52 +00:00
naruse 40d8d38909 * ext/json/lib/json/pure/generator.rb,
ext/json/lib/json/pure/parser.rb, ext/openssl/lib/openssl/x509.rb,
ext/win32ole/sample/olegen.rb, lib/date/format.rb, lib/irb/context.rb,
lib/irb/workspace.rb, lib/net/http.rb, lib/net/imap.rb,
lib/rdoc/generator.rb, lib/rdoc/markup/to_html.rb,
lib/rdoc/markup/to_latex.rb, lib/rdoc/parsers/parse_c.rb,
lib/rdoc/ri/formatter.rb, lib/rexml/parsers/baseparser.rb,
lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rss/parser.rb,
lib/uri/common.rb, lib/uri/generic.rb, lib/webrick/httpresponse.rb,
lib/webrick/httpservlet/filehandler.rb, lib/yaml/baseemitter.rb,
lib/yaml/encoding.rb: performance tuning arround String#gsub.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 06:18:06 +00:00
nobu 8e7dd55a6e * lib/uri/generic.rb (URI::Generic::inspect): use Kernel#to_s instead
object_id with printf.  [ruby-dev:33347]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-24 10:36:24 +00:00
drbrain a350a39c97 Fix Regexp warnings in lib/uri. Patch #16524 by Kornelius Kalnbach.
[ruby-core:14302]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 01:51:49 +00:00
matz 9ab6f563a2 * lib/uri/common.rb (URI::REGEXP::PATTERN): typo in REG_NAME
regular expression.  a patch from Ueda Satoshi
  <s-ueda AT livedoor.jp>.  [ruby-dev:32514]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-10 09:31:28 +00:00
akira 1c662c2b63 * lib/uri.rb, lib/uri/ldaps.rb: added LDAPS
cheme. [ruby-dev:31896]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-25 00:53:34 +00:00
nobu 12b1e59f2e * generic.rb (URI::Generic::merge_path): behave as RFC 3986.
[ruby-talk:252052]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-01 03:40:08 +00:00