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

99 Коммитов

Автор SHA1 Сообщение Дата
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