aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* mkmf.rb: library installation messagesnobu2016-01-071-6/+15
| | | | | | | | * lib/mkmf.rb (configuration, dummy_makefile, create_makefile): show library installation messages only when any files need to be updated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optparse.rb: into kwdargnobu2016-01-061-13/+14
| | | | | | | * lib/optparse.rb (OptionParser#order!): add `into` optional keyword argument to store the results. [Feature #11191] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* leakchecker.rb: remove temporary measurenobu2016-01-051-7/+31
| | | | | | | | | | | | | * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#watcher): make watcher thread restartable. * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#terminate): new method to terminate watcher thread. * test/lib/leakchecker.rb (LeakChecker#find_threads): revert r46941. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix defined? expressionsnobu2016-01-031-2/+2
| | | | | | | | * lib/rubygems/security.rb (DIGEST_ALGORITHM, KEY_ALGORITHM): should check same name as the used constants. [ruby-core:72674] [Bug #11940] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Allow ERB subclass to add token easily. [Feature #11936]seki2016-01-021-54/+77
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Fix case of frozen object with initializer.marcandre2016-01-011-1/+1
| | | | | | Bug revealed by RubySpec [ruby-core:72639] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Adding a liberal_parsing option to CSV. Patch by Braden Anderson.jeg22016-01-011-4/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ostruct.rb: deferred accessorsnobu2015-12-311-0/+5
| | | | | | | | * lib/ostruct.rb (freeze): define deferred accessors before freezing to get rid of an error when just reading frozen OpenStruct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Fix new_ostruct_member to correctly avoid redefinitionmarcandre2015-12-311-1/+1
| | | | | | [#11901] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http/responses.rb: Added new response class for 451 status code.hsbt2015-12-302-0/+4
| | | | | | * lib/net/http.rb: documentation for HTTPUnavailableForLegalReasons git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpstatus.rb: Added HTTP 451 Status Code.hsbt2015-12-301-0/+1
| | | | | | | [fix GH-1167] Patch by @MuhammetDilmac https://tools.ietf.org/html/draft-tbray-http-legally-restricted-status-00 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* forwardable.rb: adjust backtrace by tail callnobu2015-12-301-18/+28
| | | | | | | | | * lib/forwardable.rb (def_instance_delegator): adjust backtrace of method body by tail call optimization. adjusting the delegated target is still done by deleting backtrace. * lib/forwardable.rb (def_single_delegator): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Forwardable: Fix delegating to 'args' and 'block'nobu2015-12-301-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/forwardable.rb (def_instance_delegator) fix delegating to 'args' and 'block', clashing with local variables in generated methods. [ruby-core:72579] [Bug #11916] * lib/forwardable.rb (def_single_delegator): ditto. If you have a class that uses Forwardable to delegate a method to another object, and the method that returns the delegate object is called `args` or `block`, then Forwardable will fail to work. Here's a simple example: class ModelCreator extend Forwardable attr_reader :args def_delegator :args, :model_name def initialize(args) @args = args end end ModelCreator.new.model_name If you run the last line above, then you'll get: NoMethodError: undefined method `model_name' for []:Array This error occurs because `def_delegator` -- as it is written in Ruby -- uses metaprogramming to add methods to the class that will then delegate to the delegate object. So it's as if we had written: class ModelCreator extend Forwardable attr_reader :args def model_name(*args, &block) args.model_name(*args, &block) end def initialize(args) @args = args end end As you can see, `def_delegator` will not only forward the method call onto the delegate object, it will also forward any arguments provided as well. It is here that the bug arises: it splats all of the arguments into a variable which is called `args`, and because of how variable scope works in Ruby, it then attempts to call `model_name` on *this* variable and *not* our delegate object method. The fix is to call the delegate object method manually using `__send__`. (This assumes, of course, that the given receiver is, in fact, the name of a method and not the name of an instance variable, which is also a possibility.) We use `__send__` because the delegate object method could be private. So, that looks like this: def model_name(*args, &block) __send__(:args).model_name(*args, &block) end Because `def_delegators` and `delegate` use `def_delegator` internally, they also get this fix as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ostruct.rb: respond_to?nobu2015-12-291-0/+5
| | | | | | | | * lib/ostruct.rb (OpenStruct): make respond_to? working on just-allocated objects for workaround of Psych. [ruby-core:72501] [Bug #11884] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Resolv::IPv6.create: avoid modifying frozen string literalnormal2015-12-281-5/+5
| | | | | | | | * lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen * test/resolv/test_dns.rb (test_ipv6_create): test for above [Bug #11910] [ruby-core:72559] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/xmlrpc/client.rb: Support SSL options in async methods ofkou2015-12-261-5/+19
| | | | | | | | | XMLRPC::Client. [Bug #11489] Reported by Aleksandar Kostadinov. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC] Fix typosa_matsuda2015-12-2310-12/+12
| | | | | | | | | | | | | | | | | * benchmark.rb * getoptlong.rb * irb.rb * net/http.rb * net/http/header.rb * net/imap.rb * optparse.rb * pstore.rb * webrick.rb * xmlrpc.rb [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rdoc.rb: bump version to 4.2.1. It contains following fixes.hsbt2015-12-225-5/+8
| | | | | | | | | | | https://github.com/rdoc/rdoc/pull/340 https://github.com/rdoc/rdoc/pull/341 https://github.com/rdoc/rdoc/pull/367 https://github.com/rdoc/rdoc/pull/368 * lib/rdoc/*: ditto. * test/rdoc/*: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/http.rb (open_timeout): update default value in RDoc [ci skip]normal2015-12-211-1/+1
| | | | | | [ruby-core:72413] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cgi/escape: Optimize CGI.escapeHTMLnobu2015-12-201-0/+5
| | | | | | | * cgi/escape/escape.c: Optimize CGI.escapeHTML for ASCII-compatible encodings. [Fix GH-1164] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: revert r53123. It break compatibility like thor and rspec-rails.hsbt2015-12-202-6/+6
| | | | | | | | | We should try with Ruby 2.4 or 3.0. [Bug #11842][ruby-core:72374] * lib/rdoc/erb_partial.rb: ditto. * template/verconf.h.tmpl: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/utils.rb: get rid of thread leak checkernobu2015-12-191-2/+3
| | | | | | | | | | | | | * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize): use WEBrick::Utils::TimeoutHandler::Thread, which is ignored by LeakChecker#find_threads, instead of ::Thread to get rid of thread leak checker. since this TimeoutHandler is resident during tests because of Singleton, it waits for the next timeout if it has any schedules. in the case of nested timeouts, inner timeout does not cancel outer timeouts and then those schedules still remain. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* csv.rb: Fix typo [ci skipnobu2015-12-191-1/+1
| | | | | | | * lib/csv.rb (CSV#initialize): [DOC] Fix double-word typo. [Fix GH-1161] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: watcher thread namenobu2015-12-181-0/+2
| | | | | | | * lib/timeout.rb (Timeout#timeout): set watcher thread name to caller location for debugging. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): To preventngoto2015-12-181-6/+8
| | | | | | | | potential deadlocks, Queue is used to tell update of @timeout_info instead of sleep and wakeup. [Bug #11742] [ruby-dev:49387] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* csv.rb: tail commasnobu2015-12-181-36/+40
| | | | | | | * lib/csv.rb (CSV::Converters, CSV::DEFAULT_OPTIONS): supply tail commas for further elements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* csv.rb: fix typonobu2015-12-181-1/+1
| | | | | | * lib/csv.rb (CSV#shift): fix typo. [See GH-1160] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/irb/ruby-lex.rb: fixed parse error for striped heredocument syntax.hsbt2015-12-181-2/+2
| | | | | | [fix GH-1127] Patch by @koic git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove duplicated frozen_string_literal magic commentnaruse2015-12-162-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-16563-0/+563
| | | | | | 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/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): Acquirengoto2015-12-151-21/+22
| | | | | | | | TimeoutMutex only when accessing @timeout_info for avoiding potential deadlock. [Bug #11742] [ruby-dev:49387] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):ngoto2015-12-151-9/+14
| | | | | | | | | | TimeoutMutex should be acquired when accessing @timeout_info. To avoid deadlock, interrupt() calls are delayed. Due to the mutex, it is safe to treat ary without ary.dup. [Bug #11742] [ruby-dev:49387] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: Render erb with array buffer for function call optimization.hsbt2015-12-152-6/+6
| | | | | | | | [fix GH-1143] * lib/rdoc/erb_partial.rb: ditto. * template/verconf.h.tmpl: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/erb.rb: Simplify regexp to optimize erb scanner.hsbt2015-12-151-2/+2
| | | | | | [fix GH-1144] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53121 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-145-7/+6
| | | | | | | | | | | [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/xmlrpc.rb: added documentation for parser details.hsbt2015-12-141-1/+11
| | | | | | [ci skip][fix GH-1124] Patch by @jrafanie git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi.rb: fix a typo in documentation.hsbt2015-12-141-1/+1
| | | | | | [ci skip][fix GH-1140] Patch by @jutaz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/shellwords.rb (Shellwords#shellsplit): Document that thisknu2015-12-131-0/+7
| | | | | | method does not treat shell metacharacters as such. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/shellwords.rb: do not change API with frozen-string-literalnormal2015-12-131-1/+1
| | | | | | | | | | This fixes a bug introduced in r53066 when attempting to shellescape an empty string. * lib/shellwords.rb (shellescape): duplicate frozen literal * test/test_shellwords.rb (test_stringification): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/shellwords.rb: Turn on frozen-string-literal after fixingknu2015-12-131-3/+3
| | | | | | shellsplit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Have OpenStruct#dig raise if argument is not a symbolmarcandre2015-12-121-1/+1
| | | | | | nor a string. See [#11762] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems: Update to RubyGems 2.5.1hsbt2015-12-113-3/+3
| | | | | | * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* disable frozen-string-literalnobu2015-12-102-0/+2
| | | | | | | * lib/mkmf.rb, lib/shellwords.rb: disable frozen-string-literal. [ruby-core:72011] [Bug #11800] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53020 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
* optparse.rb: Fix typo [ci skip]nobu2015-12-081-1/+1
| | | | | | | * lib/optparse.rb: fix double word typo in the document. [Misc #10608] [Fix GH-1126] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(fdab4c4).hsbt2015-12-045-26/+35
| | | | | | | this version includes #1396, #1397, #1398, #1399 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/scanf.rb: fixed double words typo.hsbt2015-12-031-1/+1
| | | | | | [ci skip][fix GH-1123] Patch by @jwworth git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* csv.rb: fix encodingnobu2015-12-021-1/+1
| | | | | | | * lib/csv.rb: encoding must be plased at the first line except for shebang. [fix GH-1116] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: enable frozen_string_literal.hsbt2015-12-021-4/+5
| | | | | | [fix GH-1116] Patch by @marshall-lee git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e