aboutsummaryrefslogtreecommitdiffstats
path: root/lib/uri
Commit message (Collapse)AuthorAgeFilesLines
* Use caller with length to reduce unused stringskazu2017-10-211-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* URI::Generic: Separate no_proxy handlingnaruse2017-09-281-16/+20
| | | | | | To share with Net::HTTP. see #11195 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove commented out code of URI::HTTP.new.hsbt2017-09-111-24/+0
| | | | | | [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
* ftp.rb: fix example format [ci skip]nobu2017-08-151-2/+2
| | | | | | | * 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
* * lib/uri/common.rb: [DOC] add rdoc to describesonots2017-05-261-0/+6
| | | | | | 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
* lib/uri/generic.rb: fix typosstomar2017-05-101-1/+1
| | | | | | | * 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
* improve docs for URI::Genericstomar2017-03-191-11/+21
| | | | | | | | | | * 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
* Fix typo of URI#escape [Bug #13147]naruse2017-01-231-1/+1
| | | | | | 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
* uri/generic.rb: fix exception on non-IP formatnobu2017-01-171-2/+2
| | | | | | | * 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
* Use URI.decode_www_form_component [Bug #10774]naruse2016-12-121-5/+5
| | | | | | | `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
* Use `&.` instead of `if` and `? :`kazu2016-11-221-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update comment about default constanta_matsuda2016-11-081-1/+1
| | | | | | | | | 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
* uri/generic.rb: Tidy up mergenobu2016-10-311-31/+10
| | | | | | | * 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
* * lib/uri/common.rb: added documentation for deprecated method.hsbt2016-10-201-0/+4
| | | | | | [Misc #11960][ruby-core:72733][ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* forgot to replace two occurences of ENV.akr2016-10-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add an optional argument, env, to URI.find_proxy.akr2016-10-111-10/+12
| | | | | | | * 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
* uri/common.rb: Update URI::WEB_ENCODINGS_ [ci skip]nobu2016-10-061-2/+19
| | | | | | | * 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
* Update URI WEB_ENCODINGS_ hash, and fix documented cmd tonobu2016-10-061-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/http.rb: Documentation and code style imrovements.hsbt2016-09-301-16/+19
| | | | | | | * 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
* Don't include bad password in URI exception outputtenderlove2016-09-151-1/+1
| | | | | | | | 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
* * lib/uri/mailto.rb: Removed needless `return` and use `.`` instead of `::`hsbt2016-09-121-5/+5
| | | | | | | 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
* * lib/uri/mailto.rb (initialize): RFC3986_Parser#split sets opaquenaruse2016-07-021-0/+3
| | | | | | | | 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
* Use Integer instead of Fixnum and Bignum.akr2016-05-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* fix URI::HTTP.new examplenobu2016-03-251-2/+4
| | | | | | | * 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
* CIDR in no_proxynobu2016-02-131-3/+12
| | | | | | | * 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
* no_proxy with whitespaces and leading dotsnobu2016-02-131-1/+1
| | | | | | | | | | | | | | | | | * 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
* * lib/uri/generic.rb (URI::Generic#to_s): change encoding tonaruse2016-01-141-1/+1
| | | | | | | 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
* Add frozen_string_literal: false for all filesnaruse2015-12-169-0/+9
| | | | | | 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/uri/common.rb: make code block for rdoc.hsbt2015-12-151-6/+6
| | | | | | [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
* * ext/socket/lib/socket.rb: use safe navigation operator.hsbt2015-12-141-1/+1
| | | | | | | | | | | [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
* lib/uri/generic.rb: enable frozen_string_literalnormal2015-12-081-15/+17
| | | | | | | | | | | | | | * 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
* * lib/uri/ftp.rb: fix a typo.hsbt2015-11-081-2/+2
| | | | | | [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
* * lib/uri/rfc2396_parser.rb (initialize_pattern):naruse2015-05-191-1/+1
| | | | | | | | | 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
* * lib/uri: [doc] Update common.rb [ci-skip] [fixes GH-838]marcandre2015-02-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/mailto.rb: raising URI::InvalidComponentError insteadduerst2015-01-141-0/+4
| | | | | | | | 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
* lib/uri/common.rb: Initialize HTML5ASCIIINCOMPAT to empty Arrayduerst2014-12-301-2/+2
| | | | | | 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
* lib/uri: performance improvements [misc #10628]normal2014-12-242-53/+63
| | | | | | | | | | | | | | | | * 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
* * lib/uri/generic.rb (URI::Generic#query=): don't escape [\]^naruse2014-12-231-1/+1
| | | | | | on both rfc2396 and rfc3986. [Bug #10619] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (URI::Generic.build):naruse2014-12-011-1/+1
| | | | | | | | | | | | | | 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
* * lib/uri/mailto.rb (URI::MailTo::EMAIL_REGEXP): should escape `#`.usa2014-11-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/rfc2396_parser.rb (initialize): reduce bytecode sizenormal2014-11-061-2/+2
| | | | | | | | | | | | | 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
* * lib/uri/rfc3986_parser.rb (URI::RFC3986_Parser::RFC3986_URI):naruse2014-11-032-3/+3
| | | | | | | | 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
* * lib/uri/generic.rb (URI#inspect): remove Object id.naruse2014-10-071-2/+1
| | | | | | 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
* * lib/uri/rfc3986_parser.rb: raise URI::InvalidURIError whenglass2014-09-271-1/+5
| | | | | | | | 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
* * lib/uri/rfc3986_parser.rb: specify a regexp for :OPAQUE; generic.rbnaruse2014-09-171-1/+1
| | | | | | | | 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
* * lib/drb/acl.rb: Removed meaningless #to_s methods in interpolation.hsbt2014-08-271-1/+1
| | | | | | | | | | | | [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
* uri/common.rb: use negative look-aheadnobu2014-08-251-1/+1
| | | | | | | | * 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
* remove path_querynaruse2014-08-051-6/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/generic.rb (URI::Generic#normalize!): use String#empty?naruse2014-08-051-16/+12
| | | | | | | | * 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
* * lib/uri/http.rb (URI::HTTP#request_uri): optimized.naruse2014-08-051-5/+5
| | | | | | | 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